CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Greg Young [MVP]


Slides: AR vs Repository

Active Record and Repository (30 min presentation).

http://codebetter.com/files/45/codebetter_downloads/entry148143.aspx

I have been slowly filling in more content beyond these slides. If you happen to notice that the objects are a bit flat in the examples it is because later slides use value objects (and inheritance in some cases) to work further on the example objects.

 


Published Aug 08 2006, 03:33 PM by Greg
Filed under:

Comments

ASP.NET Podcast said:

SubscribeDownloadShow Notes:Atlanta Cutting Edge .NET User GroupFor me, its a 24 hour process to speak.Nervous.Paul...
# August 8, 2006 5:41 PM

evarlast said:

Looks like it was an excellent presentation.

I too prefer Repository and Factory(to create new instances which aren't necessarily part of a Repository) to ActiveRecord.  Yes, Castle Project's ActiveRecord and NHibernate are so awesome.

I've found myself creating Interfaces with properties for my data objects, and having my implementations inherit from ActiveRecord<> and implement those Interfaces, then use the Repository and Factory pattern with those data objects.  

It works well because working with the Interface hides the fact that the data object inherit from ActiveRecord, so I can work with the data objects in different projects, across app domain boundaries or with remoting or web services, without having to know or expose that the objects inherit from Active Record.

I'm wondering what kinds of tools and libraries do you use to help you implement data objects, their factories and their repositories quickly?  Do you have an code samples of complete systems?
# August 10, 2006 2:03 PM

Greg said:

For repositories one can create a generic repository fairly quickly. In various systems I have worked on it may be as simple as declaring a Repository<object> then adding your specific accessors ...

For tools I like to use sparx systems' .. http://www.sparxsystems.com.au/ there may be better ones out there but I know and like that one.

I believe there is a DDD sample project being worked on (unfortunately most DDD systems are in the enterprise and can't be shared often for legal reasons). I personally believe though that DDD does not lend itself well to such examples. DDD is about crafting a solution specific to the domain and will never do well with a wizard generation type system.
# August 11, 2006 1:03 AM

ASP.NET Podcast said:

Subscribe (Definitely a big deal) Pictures from the Atlanta Cutting Edge .NET User Group. Show Notes:

# January 24, 2007 10:08 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add
Check out Devlicio.us!

Our Sponsors