Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


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

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")
obj.DoStuff
...
Set obj = Nothing
It's as simple as this:
MyModule.DoStuff
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.

 

 

Sitemap