« Dissecting the DDM Tabbed View Interface | Main| New 7.x Problem? »

01/30/2007

Did you know?

Category   

In my article about the DDM tabbed view interface, I mentioned that I learned that the NotesSession and NotesUIWorkspace objects are singletons and as such, no matter how many times they are instantiated, there is only one copy ever in memory.

I am thinking that I should have known that, but honestly I didn't (but I didn't ever really think about it either.)  Applauds to Wild Bill Buchan for educating me/us on this!
 
Did you know that?

Comments

Gravatar Image1 - Hopefully enough other people will read this, and also realize that they don't really 'save' memory or performance by passing a NotesSession object around in their code (because they were afraid to instantiate it elsewhere again).

I've seen lots of code like "DoStuff(mySession)", passing a NotesSession object to the DoStuff() function....not neccessary, it just clutters up the code.

Gravatar Image2 - I knew that, but I usually just use a global Session variable because I'm too lazy to redeclare and reinstantiate it. If it's there and Notes knows it's there, why do I have to constantly tell Notes it's there? It would be awesome if Notes had some built in base level of objects that "just knew", like "this" in Javascript, or "Me" in a LS class.

Gravatar Image3 - I did know that, but it's a fairly recent piece of knowledge for me, so I too have many routines in the closet which pass around NotesSession objects Emoticon

If only this sort of stuff was properly documented somewhere eh!

Gravatar Image4 - I learned this over the summer at the Advisor Conference in Phoenix. Rocky Oliver was the imparter of this knowledge.

Gravatar Image5 - AgentContext in Java agents is similar (and a little more dangerous...)

{ Link }

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

misc links

search my blog

domino blogger search

coComments

tag cloud