Using factory pattern in DataAccess Layer

Feb 6, 2009 at 2:23 PM
Edited Feb 7, 2009 at 12:45 AM
Would anyone disagree with me that the DataAccess layer should be replaced with static methods?
Please comment!

cheers
Sean
Coordinator
Feb 8, 2009 at 9:57 AM
Hi Sean,

What are your thoughts and which area do you think static methods should be used?

One of the reason why I think the Data Layer components should have instance methods is that it will allow them to perform their assigned processing and maintain state information independently of each other.

Best Regards,
Serena
Feb 10, 2009 at 3:23 AM
Thanks Serena

I didn't realize that the data access layer maintain state for the entity objects. I was thinking if the data access layer can be implemented as a service with the static classes.

cheers
Sean
Jun 23, 2010 at 5:22 PM

But aren't you then violating separation of concerns? An entity should be able to perform processing and maintain it's own state. Data layer should be used only for communicating to the database. My 2 cents anyway. I'm looking forward to diving into this a bit more.

Coordinator
Jun 24, 2010 at 7:55 AM

Hi kaschimer,

I didn't noticed what mcsean said until your post.

I was refering to the data access component's state i.e. Connection information, and not the entities state.

Thanks.