Re: DALC vs DAO

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: UAError (null_at_null.null)
Date: 01/20/05


Date: Thu, 20 Jan 2005 13:36:34 -0500


"Leo" <leo.hart@fmr.com> wrote:

>Ah...I should clarify. When I mention DAO, it's not DAO as in the
>alternative for ADO back in the day. DAO is a design pattern. I think
>it is a GOF design pattern or at least a branch off of that. This
>might be why MS refers to it as DALC (if that's the case), in order to
>prevent confusion for MS developers.

The J2EE DAO (Data Access Object) pattern is, according to
Fowler's "Patterns of Enterprise Application Architecture",
equivalent to a "Table Data Gateway" or "Row Data Gateway"
(no, that is not a Microsoft term).

http://www.martinfowler.com/eaaCatalog/tableDataGateway.html
http://www.martinfowler.com/eaaCatalog/rowDataGateway.html

In Microsoft technology a "Table Data Gateway" would
encapsulate the logic, SQL and/or stored procedure access to
create, retrieve, update and delete result sets from the a
single table in the database and place them inside an
ADO.NET DataSet (possibly strongly typed). Note that the
DataSet may hold more than one table but each table would be
handled by a separate gateway.

Gateways tend to be used with applications that use Table
Modules.
http://www.martinfowler.com/eaaCatalog/tableModule.html

An ADO.NET DataSet can be used as a Table Module - but it
can in fact contain multiple DataTables.

More sophisticated applications would tend to use Domain
Objects
http://www.martinfowler.com/eaaCatalog/domainModel.html

which tend to be managed by Data Mappers
http://www.martinfowler.com/eaaCatalog/dataMapper.html

In a layered architecture the Active Record tends to be
avoided as it blurs the distinction between Data Access
Component and Business Component.
http://www.martinfowler.com/eaaCatalog/activeRecord.html

So Data Access Logic Components could contain gateways, or
data mappers or both. If you were using SQL-Server,
references to System.Data.SqlClient should be limited to
this layer. Ideally the same should be true for System.Data
(ADO.NET) however most of the time this will not be the case
- mainly because of the data state tracking and integration
with some GUI components.

For some patterns in the .NET context see:

Enterprise Solution Patterns Using Microsoft .NET
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/esp.asp
http://www.microsoft.com/downloads/details.aspx?FamilyId=3C81C38E-ABFC-484F-A076-CF99B3485754&displaylang=en

Data Access Logic Components usually refers to all
components the reside in the (architectural) 'Data Access
Layer':

- UI Components
- UI Process Components
- Business Service Interfaces
- Business Workflow | Components | Entities
- Data Access Logic Components | Service Agents
- Data Sources | Services

see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/distapp.asp

Ideally only data transfer objects (for simple applications)
or domain objects (for sophisticated applications) would
travel to and from the business layer.

In reality ADO.NET DataSets (due to their integration with
GUI components such as the DataGrid) will often travel all
the way to the presentation layer ultimately exposing the
relational data model to every layer of the application.

Application Architecture for .NET: Designing Applications
and Services
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/distapp.asp
http://www.microsoft.com/downloads/details.aspx?FamilyId=A08E4A09-7AE3-4942-B466-CC778A3BAB34&displaylang=en

'Any fool can write code that a computer can understand.
Good programmers write code that humans can understand.'
Martin Fowler,
'Refactoring: improving the design of existing code', p.15



Relevant Pages

  • Re: PZ Myers on Evolution without Natural Selection
    ... Design is a subset of pattern. ... this may take the form of being white in a snowy environment, ... design pattern' to accurately describe the distinction you want to ... Do you understand the concept of a tautology ?http://en.wikipedia.org/wiki/Tautology_%28rhetoric%29 ...
    (talk.origins)
  • Re: advantages of forth over other languages
    ... Design patterns are nothing more than documentation that provides a name, an intent, context, and discussion. ... The Wikipedia article on design patterns gives a good overview of the usual sections found in a design pattern: ... The purpose of pseudocode is to describe abstractly an implementation. ... The basic idea in COR is that you have some notion of a command and you pass this command on down through code that either acts on the command or passes the command on to other code that can act on the command. ...
    (comp.lang.forth)
  • Re: naming convention
    ... know that it's a pattern, so I don't want to suggest that it is. ... that's all that map-reduce is. ... where "data aggregation with map-reduce" is called a design pattern. ... Now you've got people telling you that data parallelization ...
    (comp.lang.java.programmer)
  • Re: Has anyone used design patterns in his/her C#.NET project?
    ... Although I read the entire book about Design Pattern, ... entire process and not currently need the flexibility of a factory. ... Where I routinely use factories is on communication type libraries. ...
    (microsoft.public.dotnet.general)
  • Data access pattern
    ... I'm using data access for several years now and a pattern that I always used ... values and using in slightly differents ways the ado object model (slight ... difference if it was ado or ado.net or ado.net 2.0). ...
    (microsoft.public.dotnet.framework.adonet)