Fog Creek Software
Discussion Board

Entity Class Question

Is there a layer between the entity classes and DAO that handles multiuser errors etc.

Entity Classes -> DAO


Entity Classes -> Data Access Layer -> DAO

If there is no layer how do you handle this in every Entity class?

Tuesday, January 27, 2004

You add the layer you need.

Thomas Eyde
Tuesday, January 27, 2004

Tuesday, January 27, 2004

You guys aren't very helpful and somewhat insulting.  Posting a link to the very article I have a question on?  Don't insult me.

Are entity classes based on generic data access routines that handle these errors?  If not do you simply handle the error through central error handling?

I am new to the entity class concept and am used to working with generic routines that a programmer has added to their program.  An example would be "OpenRS".  This routines would return a recordset according to a passed in SQL statement and handle any errors that occur.

Tuesday, January 27, 2004

I suppose the answer really is "it depends".

You can do it either way, depending on where you want to keep business logic, and therefore transactions.

In your position, I would be really tempted to keep it simple for the time being.


Entity class -> DAC

Where DAC is a class encapsulating the DAO/ADO whatever - incidently, you should be using ADO, not DAO.

Put the SQL statements either into the .Save and .Load methods of your entity classes or into stored procs.

Error handling is a separate issue. I suggest you have a standard handler block and use it in (almost) every function.

Tuesday, January 27, 2004

*  Recent Topics

*  Fog Creek Home