Login | Register   
LinkedIn
Google+
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: NT
Expertise: Beginner
Feb 18, 1999

MTS, ASPs, and State(less) objects

Question:
When implementing the Microsoft DNA model, it is suggested to create objects with methods only (no properties) to maintain true stateless objects. If an object will only live for the life an ASP page (i.e., not across multiple round-trips to brower and back), why are method calls that much better than using properties? And what are the potential (future) pitfalls for using properties (i.e., plans that Microsoft may have that are strictly based on the pure "stateless" model)?

Answer:
Using stateless components is a tradeoff. With stateful components, there are hundreds or thousands of mini-messages sent over the network when you make calls. Stateless components wrap those mini-messages up into a much smaller number of mega-messages, thus cutting down on network traffic. This is important even on a LAN when you have many users, but it is even more important on a WAN or on the Internet. However, the tradeoff is that the code and interfaces is much less clear and much less object-oriented. Methods tend to have a large number of parameters, which is not ideal either. And you must explicitly create persistance in a different place that where it would make the most sense (ie, the class where the data needs to persisted). You may persist the data at the UI, or in specially designated objects in the business services layer (a component does not *have* to be stateless to run under MTS).

DevX Pro
 
Comment and Contribute

 

 

 

 

 


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

 

 

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