473,394 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 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 2007
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Medi Montaseri | last post by:
Hi, Given a collection of similar but not exact entities (or products) Toyota, Ford, Buick, etc; I am contemplating using the Abstraction pattern to provide a common interface to these products....
2
by: Ryan Mitchley | last post by:
Hi all I have code for an object factory, heavily based on an article by Jim Hyslop (although I've made minor modifications). The factory was working fine using g++, but since switching to the...
1
by: Gregg Altschul | last post by:
I have a Shared Object which its sole purpose is to create objects of a certain type and return a pointer to the object to the user. Therefore, the user becomes the owner of this object and is...
5
by: ma740988 | last post by:
Consider: #include "handyfactory.h" #include <iostream> struct Shape { virtual void print() const=0; };
13
by: docschnipp | last post by:
Hi, I have a bunch of object derived from the same base class. They all share the same constructor with some parameters. Now, instead of using a large switch() statement where I call every...
16
by: Alex | last post by:
Hello, I'm trying to use a (remote) COM object from a PHP script (4.4, server has apache2 win32). The basics seem to work : I instantiate the COM object ($o = new COM"..."), then I use two of...
1
by: neoairus | last post by:
I'm developing a pseudo-library for neural network. To simplify librarary using i wont to implement a sistem to instantiate different implementation of interface(Layer.h Neuron.h) passing a string...
10
by: dolphin | last post by:
Hi All I have a question now. Can I use a string to create a object? For example ,I have a function void fun(cha *str) the str is a name of a type. If I call the function fun("int"),how do I...
5
by: CSharper | last post by:
I have created a Factory pattern code. One thing I noticed after coding, each factory has some methods they are exactly same and doing the same code using the values specific to each factory, if I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.