Click to See Complete Forum and Search --> : Deploying Components


RSchweitzer
October 10th, 2001, 10:29 AM
I am in the test phases of a 3-tier distributed application, Academy Information Management System - AIMS) written in VB6 / MSSQL Server. It was developed in a project group consisting of a UI project (AIMS_UI), a middle-tier business object project (AIMS_BO), and a data-tier object project (AIMS_BODT). During development the middle and data tiers where set to project compatibility and everything worked fine. I am now trying to deploy the middle and data tiers into a COM+ Package on our Win2K Server for testing but still have to make changes to the projects as alpha testing reviews problems. This is were I am having trouble. I want to avoid "DLL Hell" but am having problems changing between binary compatibility, compling, deploying, updating the server applications etc. The references in the project group are erratic. When I export the application proxy for AIMS_BO sometimes it works on my production machine but when I try it on other client test machines somettimes it works and other times (more often) it doesn't. Any advise on the proper sequence for compiling, registering, and switching between project mode and COM+ distributed mode.

Cakkie
October 10th, 2001, 11:25 AM
DLL Hell, have been there before...

Okay, where to start, ah, interfaces.
The interface is the only components that need to be set to binary compatibility. Once that is done, start createing your components. From this point on, your interface SHOULD NOT CHANGE anymore, so think before you act. Once you start creating components, set (or leave) those components compatibility to project.
When you have your components, add them to COM+ using Component management on the server. If they don't want to install, make sure previous version are removed, and make sure the interfaces are registered, to be sure, you should use regsvr32 on the interfaces before adding the components to COM+. Once installed and all permissions set, create a proxy application. Install that on the clients and normally you shouldn't get any errors saying the component doesn't support the given interface. Also make sure that previous installations of the application proxy are removed before installing, otherwise you will get this error saying almost nothing.

Good Luck

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook

RSchweitzer
October 10th, 2001, 12:43 PM
Thanks for the reply!
A few follow-ups....if you have time!
(1) The interface I am using is the default interface that I believe VB places with the compiled DLL. How do you set the interface to Binary compatibility separate from the implementation. I am only familiar with one compatibility setting for the whole project.

(2) I created the COM+ server application and then I just drag the DLL into it which I assume registers it at the same time. I then export my proxy. After I make changes to the project on my development machine I delete the components out of the Server Application and drag the new DLL in. Is this incorrect?

Appreciate you help!!!

Cakkie
October 11th, 2001, 01:11 AM
1) Ouch, you should never use the default interface when using COM+! When doing that, you must always recompile, and re-add your components when you make changes to them. Also, when other components refference that component, you will need to recompile them as well! So create an interface for your components, you can use the same interface for multiple components. In our case, we only have 3 interfaces, we have ISql, which is the interface of our data object, and we have IRetrieval and IModification. IRetrieva has one method called GetData, IModification has 3 methods nl Add, Update, Delete. These interfaces are used by approx +100 (and counting) components. Changing one of those interfaces would result in us having to recompile half of the components. Also, place the interfaces in seperate dll's, which is way easier to manage them.

2) When adding a component to COM+, COM+ will automatically do the required stuff like registering it. If your interfaces are seperate (my advice is to do this), you will need to register you interfaces manually. When you change it, you will need to re-add it as you implied, unless your server is your development machine, in this case, VB will do that when compiling. If you don't do any mayor changes (like implementing a new interface), you don't even need to redistribute the DLL to the clients, since they only have the typelib of the dll, which should be about the same as the combination of all it's interfaces it supports.

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook