Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbie to ORM

 
Stan F Smith
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I wasnt sure if I should post this in the newbie section or here.. Anyway I am trying to find the right way do desgin a program. I have multiple data sources from which I will create my objects. Would it be correct to create the objects as I want (merging multiple sources) in the data layer and return a complete object to the service layer (even if it requires a bit of business logic) or should the data layer be completly "dumb" and return multiple sets of data to the service layer where I will then create my objects?

Thanks.
 
Tim Holloway
Saloon Keeper
Posts: 18362
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I've been using a 2-layer approach lately. I need "business logic" that must run inside a transaction with attached objects. Those functions go in my Service layer. To keep access to individual tables simple, the Service layer calls DAO objects in the lower-level Persistence Layer.

I put quotes around "business logic" because most of the "business" involves manipulating object relationships and stuff like that. I prefer the real business logic to be above the database transaction level, working with the detached objects.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic