Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: VB6,VB7
Expertise: Intermediate
Aug 3, 2002



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Reduce COM+ context overhead: use modules and shared members

If you use Shared members in .NET or modules in VB6, you reduce COM+ context overhead without any risk whatsoever that you will get extra context overhead for that code. You also release yourself from the clean-up burden that you have in both worlds. Instead of the VB6 consumer code:

Dim obj As MyServer.MyComponent
Set obj = CreateObject("MyServer.MyComponent")
Set obj = Nothing
It's as simple as this:
Perhaps you don't think that this tip results in good object orientation? Well, if a method doesn't need any instance state, then why should you use an instance? I don't think you should, unless you don't need to remote the method on its own. Ask a Java friend if they think Static methods are useful. The odds are that the answer will be "yes".
Jimmy Nilsson
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date