|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Shared/Static methods & functionsWhen designing a n-tier architecture, what is the preferred method/function
accessibility? <Specifically for asp.net apps> A private constructor and shared/static methods & functions? A public constructor and non-shared/static methods & functions? Are there any drawbacks with regards to performance with either model? Thanks, Morgan Hi,
> A private constructor and shared/static methods & functions? This approach (and the Singleton design pattern) are good for objects who should have only one instance. These include various facades, utility classes etc. > A public constructor and non-shared/static methods & functions? This approach is recommended for classes representing business entities, where there can be an arbitrary number of instances. -- Show quoteSincerely, Dmitriy Lapshin [C# / .NET MVP] Bring the power of unit testing to the VS .NET IDE today! http://www.x-unity.net/teststudio.aspx "MPF" <a***@senditon.com> wrote in message news:OPl9R2Q%23EHA.3840@tk2msftngp13.phx.gbl... > When designing a n-tier architecture, what is the preferred > method/function accessibility? > <Specifically for asp.net apps> > A private constructor and shared/static methods & functions? > A public constructor and non-shared/static methods & functions? > > Are there any drawbacks with regards to performance with either model? > > Thanks, > > Morgan > > > > Thanks for the clarification.
Show quote "Dmitriy Lapshin [C# / .NET MVP]" <x-code@no-spam-please.hotpop.com> wrote in message news:%232siPQW%23EHA.1084@tk2msftngp13.phx.gbl... > Hi, > >> A private constructor and shared/static methods & functions? > > This approach (and the Singleton design pattern) are good for objects who > should have only one instance. These include various facades, utility > classes etc. > >> A public constructor and non-shared/static methods & functions? > > This approach is recommended for classes representing business entities, > where there can be an arbitrary number of instances. > > -- > Sincerely, > Dmitriy Lapshin [C# / .NET MVP] > Bring the power of unit testing to the VS .NET IDE today! > http://www.x-unity.net/teststudio.aspx > > "MPF" <a***@senditon.com> wrote in message > news:OPl9R2Q%23EHA.3840@tk2msftngp13.phx.gbl... >> When designing a n-tier architecture, what is the preferred >> method/function accessibility? >> <Specifically for asp.net apps> >> A private constructor and shared/static methods & functions? >> A public constructor and non-shared/static methods & functions? >> >> Are there any drawbacks with regards to performance with either model? >> >> Thanks, >> >> Morgan >> >> >> >> > |
|||||||||||||||||||||||