I'm tackling my first n-tier OO project using SQL Server, NT Server, MTS,
I realize VB is not particularly OO-pure, and in part that is what this post
is about. I'd appreciate any thoughts/opinions in reply.
MSDN has a sample project called Duwamish Books, including source code for
the various tiers. Looking over the code, I'm struck by the degree to which
well-formed business objects have been sacrificed for the sake of optimizing
The Business Logic Layer contains three classes - one holds methods that are
transactional, another non-transactional, and a third for methods that
support (but do not require) transactions.
For example, the transactional class contains these methods:
The nontransactional class contains methods like:
I believe they are partitioned in this way so that their transactional
behavior can be set in MTS. But this design really seems to completely
disregard the application's business classes. Basically, it's just a
laundry list of functions stuffed into a class, and the classes are entirely
based on an implementation issue (transaction support) instead of business
In the Client code (UI layer), there are classes like COrder, CAuthor, etc.,
but they just consist of property gets/lets. There appears to be no
processing at all going on inside these classes. Instead, a lot of the
processing for many of the classes is lumped into a code module named
I would expect the classes themselves to have operations like:
It seems that classes are simply used to hold a bunch of methods from the
same tier without any regard for creating well-formed business objects. It
seems a great deal of attention is given to the multi-tiered aspects of the
project, not much to object orientation.
Is there some way to keep the automated transaction management without
totally disintegrating logical classes into tier-oriented components? Do we
have to completely sacrifice the design for performance reasons?
Also, there is much talk about "stateless" components being ideal for
hosting in MTS. If you take away the state, basically we're talking about a
bunch of function calls, right? Doesn't this mean we've thrown away much of
the design advantages that come with OO?
Does anyone else have any thoughts on this?? As I said, I'm new to this,
and perhaps I'm missing something. Maybe my "world view" is a little skewed
by the OO texts I've been reading... On one hand I want to get going and
this project underway, and on the other, I'm hesitant to start a project
a design I find questionable.
I would love to get some feedback on this - especially from developers
who have encountered this before and found a way to do it and still sleep
well at night!