Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM vs COM+ 2

Status
Not open for further replies.

IonelBurtan

Programmer
May 25, 2001
601
RO
1. I need to know what are the main differences between COM and COM +.
2. What drawbacks and and advantages has one against the other?
3. When and Why I should choose one of them?

{just theory, no code}

Thank you,
s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darkness...
 
COM is a software-component technology, while COM+ makes use of those components to provide additional scalability and performance in an n-tier architecture.

Chip H.
 
-chiph
"additional scalability and performance in an n-tier architecture"

Please tell me more about this COM+ feature. What are the means COM+ uses for reaching these goals?

Thanks,
s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
COM+'s main method of adding scalability and performance is done through object pooling. Unfortunately, this requires a free-threaded component, which is something VB6 cannot do. But... .NET (any language) and C++ can.

What object pooling does is you tell MTS/COM+ to create a pool of available objects, from a minimum that gets created when COM+ starts, to some maximum (which I don't know if it's a hard maximum, or if it's flexible). What pooling does for you is provide a caller with a pre-initialized object. This is much faster than waiting for an object to be created (especially over a network). The caller connects to the object, makes method calls, and disconnects. The object then goes back into the pool.

It does require a fundamental change in program architecture. Before COM+, everyone would open a connection to a database and leave it open for the duration of the application. This was OK when the user population was <100, as the load on the server was managable (each connection takes up RAM). But for large populations or unknown quantities of users (e.g. users from the Internet), the database server gets overloaded quickly. Someone realized that each transactional user was actually doing real work a small percentage of the time -- the rest of the time they were idle.

So your programs must make a connection, make a request, get the results, and then disconnect (this also applies to non-database objects). This also implies that the application be stateless (program state is not maintained between requests). Because... the object that you're currently using belonged to someone else 200 milliseconds ago. And when you get through using the object, another user will be using it after you. So the objects cannot keep any information around -- they must be code only.

If you need to maintain state (and almost everyone does), there are a few techniques available -- Storing the info in a database table, storing it in a cookie on the user's machine, storing it in the session variable in IIS, and probably a couple I've forgotten. Storing it in the session variable has it's own problems when running in a load-balanced web-farm environment, as between calls the users could be sent to a different IIS server than the one where their session-variable is stored. It also causes the IIS server to consume RAM. Some of the load-balancers will cause this information to be shared amongst the IIS servers, but it's been my experience that this techology isn't quite there yet.

Hope this helps.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top