Stephen Cohen's thoughts on Enterprise Architecture

Five things about implementing Enterprise Architecture

Developing a broadly available set of services upon which your enterprise will rest is a daunting task.  Typically difficult issues such as performance, scale, and availability need to reach 10 or 100 times that of a single application.  Consider a simple logging mechanism.  Implemented for enterprise consumption it  needs to support hundreds of concurrent users not just a single local desktop, writing thousands of rows per second instead of tens of rows per minute, and provide process isolation so one user can corrupt another’s information.  All this and you are not allowed to degrade security.  No performance tricks like pooling database connections on a single user ID. And of course, everything must work, all the time, for everyone.

Microsoft has given us a hand to achieve these goals... COM+ hosted components and the .Net frameworks Enterprise Services namespace create a safe, performant, and scalable environment.  I am a huge fan of COM+.  Object pooling, Just-In-Time-Activation, and role based security are the cornerstones of any Microsoft based enterprise architecture implementation.  Add in Network load balancing on the front and database server clustering on the back and you real safety and stability right out of the box.

Of course it's not all that simple.  Implementation details are wrapped in confusion, complexity, and aggravation.  COM+ documentation is very intricate and, in my opinion lacking in step-by-step details.  At least for now there seems to be a fair amount of lore handed down from developer to developer.  Even that is cloaked is bounded by personal experience as full of ambiguity.  So here is my short list of things that drive me nuts in a product set I love to implement.

#1: Why do I have to apply [AutoComplete] when I turn [JustInTimeActivation] on?  I suspect it is nice to be selective as to which methods use JITA but the IDE auto-generates so much code now can't we get this one.

#2: COM+ is fast.  REALLY FAST.  By some accounts COM+ components are 30 times faster than plain old unmanaged code.  So why is the reputation, and much of the documentation, about the performance costs?  Like most things, done poorly it is slower, but done well, it rocks.

#3: Why do people try to apply stateful patterns to the COM environment?  I have a mantra .. small, stateless, fast.  Whenever I am designing parts for a Microsoft environment I want them to be as small as possible, each focused on accomplishing a single task.  I don't hold state in the middle tier (it's fine in the client or the database) because I want to use pooling.  And I want these parts to go in and out of memory as fast as I can, again to support pooling.  If you try to do stateful things you will not get the benefits of Enterprise Services and you will forever chase performance, scalability, and concurrency.  It can be done ... but it's just not as easy.

#4: If I have no impact on your approach other than this ... please ... Don't wait for the end of the project to consider security.  My grandparents use to never lock their home.  Today, I don't walk away from my keyboard without locking my computer.  It's an evil world and we are responsible for the future safety of our users.  Enterprise Services and COM+ provide for flowing Identity, access to the SecurityContext, and role-based security.  Use them.  Know who is doing what at all times and code for the "good" scenarios to the exclusion of all other paths.

#5: If software is a team sport (and I for one believe it is) then an enterprise architect is the coach.  I'm not much for sports analogies but here it goes.  Most teams have an offense and a defense.  They perform different tasks, requiring different skills, and generally run counter to each other.  Enterprise work requires Software and Hardware.  Our job as architects is to leverage both, striking a balance as needed for the task at hand.  It is as important to understand clustering and load-balancing as it is to know when a member variable is going to cause JITA to fail.

Published Monday, March 08, 2004 3:43 PM by Stcohen
Filed under:

Comments

 

COM+ is fast. REALLY FAST? said:

Is there some performance data to demonstrate COM+ is indeed faster, and explanation why you think it would be the case when COM+ uses so much interception to enable its declarative transaction management? Or you were refering to the component pooling feature in COM+ vs creating component every time it's used?

W
March 8, 2004 5:34 PM
 

Stephen Cohen said:

Sadly, I don't know of any public metrics. I have done some with my customers and will poll them to see if they will allow me to post the results.

The speed I am referring to is really a net effect (if you will forgive me for the pun). The cumulative value of pooling, caching, and JITA overcome the cost of interception. That said, I wonder how you could do these things in an equally generic way that doesn't use interception of some kind?

If you focus on transactions I encourage you to look at the performance of many (say 500,000) over a period of time for many different user access profiles (some percentage of readers vs. writers with some report generators). On a single transaction the cost seems high but in an operational scenario the benefit again out weighs the cost.
March 8, 2004 5:54 PM
 

Matt W said:

We just finished rolling out a client/server app (and assorted web apps) using COM+ for the data tier. They were what you describe, small and stateless and simple. We had a simple code generator create all of the basic data objects which mapped directly to tables, and had that all of these supported transactions (I forget the COM+ attribute right now). When we needed anything that was beyond a single insert (eg, a hand written data access component) we turned on autocomplete and it worked great. Transactional integrity with little of the "hard stuff" <p>
The only problem that we had was in setting up the development environment, and subsequently, the deployment environment. These components were shared amongst 3 or 4 applications, each a different VS.NET solution, and it seems like each developer referenced the assembly differently because we were constantly getting really nasty COM+ errors being generated that had to do with incompatable versions and what not. What is the best way to reference a component that is still in development (fix the version num, ???), in order to avoid tensions with the rank&file who were quite turned off by the whole COM+ thing?
March 8, 2004 8:45 PM
 

Stephen Cohen said:

My first suggestion comes from the last week I spent coding with Juval Lowy of iDesign. <plug> www.iDesign.net </plug> He knows more about COM+ development than I ever will. Among the many gems he shared was the idea of PNC’ing an app in development. You may be familiar with the drill;

PNC = Purge Nuke and Cleanse

Purge all of the current assemblies from GAC. Yes go directly to windows\assembly, seek and delete. Nuke all of the running components in the component management console. If they are running you will get ghosts in your machine and not the gentle friendly kind the Police sang about. Some dll you killed in the last step has entered the modern version of terminate and stay resident. Software exorcism is possible. Finally, Increment the version numbers on you parts to force a “real” compile/build and then deploy …ahhhh … Fresh as a morning breeze.

This needs to be as automated as possible and followed like a new religion. As you mentioned, the number of moving parts in a real enterprise environment can quickly become unwieldy.

Next to that, good design and rigorous process are your friends. If you are working in a layered architecture you will need to decide how you use your team. Ideally you would limit the binding between layers by implementing interface classes. COM and interfaces go well together anyway. Providing reasonably stable, exportable interfaces protects the developer relying on them and drives the creator to better think through the problem at hand.

March 8, 2004 9:05 PM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker