B
BotRot
Hello C#.NET Forum,
I have a desktop application, (very) near completion. The application is
constructed in C# .NET 3.5 SP1, and the application files produced by the
application are MS Access 2007 Database (with the extension changed to suit the
application. The application file only consists of tables and relationships,
specifically for the application's purposes.
Generally there are two separate tiers for the data, a DataBroker which managers
the OleDb functionality specifically for MS Access, and a more "strongly" Data
Access Layer that utilises the data DataBroker, and serves the Business Tiers.
I decided (hopefully not incorrectly) to make the DataBroker instancing (as in not
like other DAAL helper class that perform on servers, as static).
My questions are basically, would it be better to;
1) Have my AccessHelper (in my DataBroker) as static? Then using it in my Strong
Typed Data Layer's classes
2) Have AccessHelper as instancing, and in my "strongly" Typed Data Layer, wrap it
in a singleton class, and use the singleton instance in my Typed Data Layer's
classes?
3) Have AccessHelper as instancing, and in my "strongly" typed Data Layer, wrap it
in a static class, and use the singleton in my Strong Data Layer's classes?
At the moment I have implemented (almost finished) number 2). My main reason for
asking is cause I'm always seeking the best way to implement a design. Googling
this topic yield lots of developers, each implementing either 1), 2), or 3), each
having very good reasons for doing so, can they all be the best way? Given this
as a desktop app, one application instance per application file.
Thanks and regards,
- BotRot
I have a desktop application, (very) near completion. The application is
constructed in C# .NET 3.5 SP1, and the application files produced by the
application are MS Access 2007 Database (with the extension changed to suit the
application. The application file only consists of tables and relationships,
specifically for the application's purposes.
Generally there are two separate tiers for the data, a DataBroker which managers
the OleDb functionality specifically for MS Access, and a more "strongly" Data
Access Layer that utilises the data DataBroker, and serves the Business Tiers.
I decided (hopefully not incorrectly) to make the DataBroker instancing (as in not
like other DAAL helper class that perform on servers, as static).
My questions are basically, would it be better to;
1) Have my AccessHelper (in my DataBroker) as static? Then using it in my Strong
Typed Data Layer's classes
2) Have AccessHelper as instancing, and in my "strongly" Typed Data Layer, wrap it
in a singleton class, and use the singleton instance in my Typed Data Layer's
classes?
3) Have AccessHelper as instancing, and in my "strongly" typed Data Layer, wrap it
in a static class, and use the singleton in my Strong Data Layer's classes?
At the moment I have implemented (almost finished) number 2). My main reason for
asking is cause I'm always seeking the best way to implement a design. Googling
this topic yield lots of developers, each implementing either 1), 2), or 3), each
having very good reasons for doing so, can they all be the best way? Given this
as a desktop app, one application instance per application file.
Thanks and regards,
- BotRot