Wednesday, May 14, 2008

AOP and IoC using Enterprise Library and Unity

with Erik Renaud and Francois Tanguay

Definitions

AOP - Aspect Oriented Programming
IoC - Inversion of Control
Enterprise Library - fills enterprise needs

IoC

  • Promotes SoC
  • Relies on external mechanism to do the injection
  • All about contracts (interfaces)
    • Between layers
  • Objects shouldn't know each other, just know about each other

AOP

  • Promotes SRP
  • Cross-cutting

Unity

  • Can do singleton with ContainerControlledLifetimeManage parameter
    • Thread safe
  • Can have multiple mappings with names instances
  • Can auto-wire construction dependencies and setter dependencies

PIAB

  • You have to be careful with the execution of attributes

EFPRS

  • Use DI for wiring
  • Use AOP for security and logging

Notes

  • Unit Tests
    • Arraign, Act, Assert
  • Ctrl+E+D - Reformat everything

Tools

  • Unity for IoC
  • PIAB for AOP

No comments: