SLIDE 1 Presented in partnership with
SLIDE 2
Sponsors
SLIDE 3
An Introduction to Castle ActiveRecord, or Stop Writing CRUD!
SLIDE 4
Writing CRUD sucks!
SLIDE 5
Every day, you are challenged to get more done in less time.
SLIDE 6
You want to focus on real business value and stop being a plumber.
SLIDE 7
In the end, it’s about having more time to do what’s really important.
SLIDE 8
What is the Castle Project?
MonoRail ActiveRecord MicroKernel Windsor
SLIDE 9 What is Castle ActiveRecord?
Castle ActiveRecord is an implementation
pattern for .NET implemented using Nhibernate.
SLIDE 10 The Pattern
“An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic
SLIDE 11
Its purpose is to relieve the developer from a significant amount of relational data persistence-related programming tasks.
What is Nhibernate?
SLIDE 12
Code Walkthrough – The Old Way
SLIDE 13 The ActiveRecord Way
- Very little configuration
- Extend from a base class
– ActiveRecordBase<T> – ActiveRecordValidationBase<T>
– [ActiveRecord] – [PrimaryKey] – [Property] – [HasMany] – [BelongsTo]
SLIDE 14
Code Walkthrough – ActiveRecord
SLIDE 15 Things to think about
- Text columns
- Lazy Loading
- Web apps require “isWeb=true”
- ActiveWriter
SLIDE 16 ActiveWriter
- Drag & drop design surface
- 1-way generation
– Partial classes
SLIDE 17
Lazy Loading
ActiveRecord supports lazy loading BUT You should check this link out http://is.gd/71h
SLIDE 18 Pros and Cons
– Simple, yet powerful – NHibernate behind the scenes and readily available when more power is needed
– Not a good fit for complex schemas or for batch
SLIDE 19 Contacting me
- My Blog: http://mjeaton.net
- Email: mjeaton@gmail.com
- Twitter: http://twitter.com/mjeaton
SLIDE 20 References
– http://castleproject.org
- Martin Fowler’s ‘Patterns of Enterprise
Application Architecture’
– http://www.martinfowler.com/eaaCatalog/
– http://www.hibernate.org
SLIDE 21