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).

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may

man on floor with data

DevX Quick Guide to Data Ingestion

One of the biggest trends of the 21st century is the massive surge in internet usage. With major innovations such as smart technology, social media, and online shopping sites, the internet has become an essential part of everyday life for a large portion of the population. Due to this internet

payment via phone

7 Ways Technology Has Changed Traditional Payments

In today’s digital world, technology has changed how we make payments. From contactless cards to mobile wallets, it’s now easier to pay for goods and services without carrying cash or using a checkbook. This article will look at seven of the most significant ways technology has transformed traditional payment methods.