471,596 Members | 804 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,596 software developers and data experts.

Object factory and interface class

A few design issues:
1. If I decide to implement an interface between my "business object
layer" and my "data access layer", so as to protect the BOL from
changes in DAL, do I provide ONE interface class containing all the
other required interface, or do I expose several separate interface to
the DAL? (Seems conceptualy cleaner to provide on interface class, and
stuff everything I need in it)

2. I i decide to provide an "object factory", so as to create my object
on the fly using a config file (Oracle vs SqlServer) should the factory
be encapsulated in the interface, or should it be at the same level as
the interface (BOL-DAl), or shoud it be global to all layers?

Thanks

Jan 31 '06 #1
1 1950
It may depend on what type of things the DAL does.

For instance if the DAL had the following things that it handled:

DB access
Email access
Logging

Then you may want to have several interfaces (one for each group) that way
they could be reused by other layers in pieces instead of the whole thing.
Chances are, also, that your DAL will not be in one specific class - you
will probably have several classes that make up your DAL. If that is the
case then having a single interface for each class would make more sense
also.

If you only have a few methods to your DAL (maybe just DB access) then
having 1 interface that contains all the methods would be fine.

If there are 20+ methods that make up your DAL then having 1 interface may
not be the best solution.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Charles Cox
VC/VB/C# Developer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<gu****@yahoo.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
A few design issues:
1. If I decide to implement an interface between my "business object
layer" and my "data access layer", so as to protect the BOL from
changes in DAL, do I provide ONE interface class containing all the
other required interface, or do I expose several separate interface to
the DAL? (Seems conceptualy cleaner to provide on interface class, and
stuff everything I need in it)

2. I i decide to provide an "object factory", so as to create my object
on the fly using a config file (Oracle vs SqlServer) should the factory
be encapsulated in the interface, or should it be at the same level as
the interface (BOL-DAl), or shoud it be global to all layers?

Thanks

Feb 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Medi Montaseri | last post: by
2 posts views Thread by Ryan Mitchley | last post: by
1 post views Thread by Gregg Altschul | last post: by
5 posts views Thread by ma740988 | last post: by
13 posts views Thread by docschnipp | last post: by
16 posts views Thread by Alex | last post: by
10 posts views Thread by dolphin | last post: by
5 posts views Thread by CSharper | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.