472,371 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Separate DAC from BO logic? What about physical assembly?

I'm looking for people's opinions and feedback regarding the design of the
application tier, and how to best logically separate out the Data Access
from the Business Object's. Per the Microsoft prescriptive architecture
documents, they recommend creating a completely separate logical Data Access
Tier of components. Then creating a separate tier of Business Objects that
consume them.

My first question is...what does this actually buy you in the real world?
Ok, if you need to in the future totally re-write your Data access to a new
Database server like Oracle or DB2, I can see separating out the code.
However, in the scenario where you know you will be writing to a single DB
server...what else does this approach buy you? You'll be running the BO and
DAC on the same physical server anyway. Also, adding that new tier
inherently add's to the complexity of your solution...you now pretty much
double the amount of classes, with each BO having a corresponding DAC
component. Is there other pros to this approach? As opposed to having a
single BO that contains your DAC methods directly?

The next question is, say that you do choose to have a separate DAC tier.
Now..when creating your assemblies, how do people recommend breaking out the
code as far as projects and solutions? For example, I have seen solutions
which create a separate DAC project and put a majority of their DAC classes
in there. This creates a physical assembly which now needs to be accessed
from the BO. Doesn't this impose an unnecessary performance penalty?

The other option is to creat separate projects based on core functionality
and include both the BO and DA classes in that single project. They then get
deployed as a single assembly and you remove the overhead of separate
assemblies.

Is there a best practice here? What's the pros/cons that people see?

Thanks for your feedback!
Jul 21 '05 #1
2 1704

"Mike Hennessy" <mh*******@brassring.com> wrote in message
news:uV**************@TK2MSFTNGP09.phx.gbl...
I'm looking for people's opinions and feedback regarding the design of the application tier, and how to best logically separate out the Data Access from the Business Object's. Per the Microsoft prescriptive architecture documents, they recommend creating a completely separate logical Data Access Tier of components. Then creating a separate tier of Business Objects that consume them.

My first question is...what does this actually buy you in the real world?

It allows you to easily change from one database to another,
without having to rewrite a lot of your business code. For
example, you may have an application that you want to deploy to a
small company who just wants to use MySQL as a DB, but then you
may need to use this same app in a large enterprise that is
standardized on Oracle. By seperating out the data access
components, you merely switch which set they are using and
nothing else.

Ok, if you need to in the future totally re-write your Data access to a new Database server like Oracle or DB2, I can see separating out the code. However, in the scenario where you know you will be writing to a single DB server...what else does this approach buy you?
What happens when the Business Logic changes due to new laws or
requirements? When you have the data access intermingled all
throughout your business objects making changes to the business
logic may screw up your data access code.
You'll be running the BO and
DAC on the same physical server anyway. Also, adding that new tier inherently add's to the complexity of your solution...you now pretty much double the amount of classes, with each BO having a corresponding DAC component. Is there other pros to this approach? As opposed to having a single BO that contains your DAC methods directly?


Basically, if you are going to be able to write this app once,
and then never look at it again then it doesn't really matter.
However, in the real world this rarely ever happens. We find that
there are bugs, or new features required, etc.. By modularizing
your application as much as is logically possible, you can make
changes or fixes in one piece of code, and minimize the negative
impact it will have on other components.
Andrew Faust
Jul 21 '05 #2
Hi Andew, thanks for the reply.

You said in your message:
What happens when the Business Logic changes due to new >laws or
requirements? When you have the data access intermingled >all
throughout your business objects making changes to the >business
logic may screw up your data access code.


I'm NOT suggesting writing Data Access code directly in a BO method.
What I'm saying is that, yes, create separate DAC methods...but create
them in the BO directly, instead of creating a totally separate class
file. This still keeps the DA logic separate, but it's in the same BO.
Per your question above, regardless of whether those methods live in the
BO or in a separate DAC, you will STILL have to make the change to a
component. In my case, you can make the changes in a single component,
where in your case, you will make a change to the BO AND the DAC
component. Again...I don't see how the physical separation buys you
anything UNLESS you are planning on being able to change your DB
backend.

Is that pretty much the argument?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: Robert Brown | last post by:
Let's say I have a type hierarchy: (just an example) the general entity customer: CREATE TABLE customer(customer_id int, customer_name varchar(250), customer_type int) three specific...
1
by: cmo63126 | last post by:
I'm currently refactoring a small to mid-size web application. One of my goals is to keep my layers as loosely coupled as possible. I've created 3 separate assemblies (Web GUI, Business Logic,...
6
by: Pete Davis | last post by:
I'm confused about what precisely the limitations are on loading plugins in separate app domains. In all my previous apps that supported plugins, I've loaded them into the same domain as the app,...
1
by: Rupert | last post by:
I am developing a system in ASP.NET and am new to the technology. I am running everything on the laptop I am developing on (windows xp). The DB is Oracle and my aspx pages and C# code behind...
2
by: Mike Hennessy | last post by:
I'm looking for people's opinions and feedback regarding the design of the application tier, and how to best logically separate out the Data Access from the Business Object's. Per the Microsoft...
3
by: LurfysMa | last post by:
I would like to hear opinions on the tradeoffs of putting the tables, forms, and queries for several related datasets in separate databases vs one combined database. I am working on an...
1
by: Tony Johansson | last post by:
Hello! If I select a private assembly in ILDASM I get a lot of information listed but if I select a shared assembly located at c:\window\assembly(GAC) I get nothing listed. So is this normal...
22
by: pbd22 | last post by:
hi. I am having probelms with an update statement. every time i run it, "every" row updates, not just the one(s) intended. so, here is what i have. i have tried this with both AND and OR and...
15
by: bruno.desthuilliers | last post by:
On 27 juin, 18:09, "John Salerno" <johnj...@NOSPAMgmail.comwrote: For which definitions of "content" and "logic" ??? The point of mvc is to keep domain logic separated from presentation logic,...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.