RE: n-tier performance trade-off (guidance needed)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I agree with you, creating objects for each method seems like an inefficent
thing to do. I can tell you that the runtime's garbage collector is designed
to efficiently remove objects from the heap that are short-lived so even if
you are creating an object on each method call, it should not adversly affect
performance. If you want to avoid the object creation code, then I suggest
you consider the Singleton design pattern so that once you create the object,
you hang onto it and avoid creating it again upon subsequent use.

--
Jorge L. Matos



"David" wrote:

> I understand the need for n-tier architecture if an app is to be scaled-up
> for server farm deployments. And I can also appreciate that separating UI
> from business-logic from data-access is simply good design, if only from the
> point-of-view of "encapsulation" and functional layering.
>
> HOWEVER, I'm having a hard time justifying to our devl staff (many of who
> are 20+ year veterans, like myself), why in a "desktop" app which will never
> be deployed in a server-farm environment that we need to incur the overhead
> of having separate physical layers (be they web services or remoting).
>
> And more specifically, why develop in a "stateless" paradigm, in which on
> every user interaction we instantiate the BL which instantiates the DAL? (as
> Duwamish and other examples do).
>
> Why not just have the "upper" layer instantiate the "lower" object ONCE and
> then hold that instance reference? Again, I fully appreciate why a stateless
> design is needed for server farms. But why incur the overhead of repeated
> object instantiation/collection for a "desktop" app?
>
> Or have we gotten to the point where the mere idea of a "logically layered
> but physically monolithic" app is now heresy?
>
> (BTW: is there a newsgroup that has a general but CONCRETE discussion of
> n-tier practicality?)
>
> Thanks,
>
> David
>
>
.



Relevant Pages