presented in partnership with sponsors
play

Presented in partnership with Sponsors An Introduction to Castle - PowerPoint PPT Presentation

Presented in partnership with Sponsors An Introduction to Castle ActiveRecord, or Stop Writing CRUD! Writing CRUD sucks! Every day, you are challenged to get more done in less time. You want to focus on real business value and stop being a


  1. Presented in partnership with

  2. Sponsors

  3. An Introduction to Castle ActiveRecord, or Stop Writing CRUD!

  4. Writing CRUD sucks!

  5. Every day, you are challenged to get more done in less time.

  6. You want to focus on real business value and stop being a plumber.

  7. In the end, it’s about having more time to do what’s really important.

  8. What is the Castle Project? MonoRail ActiveRecord MicroKernel Windsor

  9. What is Castle ActiveRecord? Castle ActiveRecord is an implementation of the ActiveRecord pattern for .NET implemented using Nhibernate.

  10. The Pattern “An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.”

  11. What is Nhibernate? Its purpose is to relieve the developer from a significant amount of relational data persistence-related programming tasks.

  12. Code Walkthrough – The Old Way

  13. The ActiveRecord Way • Very little configuration • Extend from a base class – ActiveRecordBase<T> – ActiveRecordValidationBase<T> • Attributes – [ActiveRecord] – [PrimaryKey] – [Property] – [HasMany] – [BelongsTo]

  14. Code Walkthrough – ActiveRecord

  15. Things to think about • Text columns • Lazy Loading • Web apps require “ isWeb =true” • ActiveWriter

  16. ActiveWriter • Drag & drop design surface • 1-way generation – Partial classes

  17. Lazy Loading ActiveRecord supports lazy loading BUT You should check this link out http://is.gd/71h

  18. Pros and Cons • Pros – Simple, yet powerful – NHibernate behind the scenes and readily available when more power is needed • Cons – Not a good fit for complex schemas or for batch operations.

  19. Contacting me • My Blog: http://mjeaton.net • Email: mjeaton@gmail.com • Twitter: http://twitter.com/mjeaton

  20. References • The Castle Project – http://castleproject.org • Martin Fowler’s ‘Patterns of Enterprise Application Architecture’ – http://www.martinfowler.com/eaaCatalog/ • NHibernate – http://www.hibernate.org

Recommend


More recommend