Friday, October 21, 2011

ghost of patterns past

The jay-sea-em-es pattern may be revisited. Namely:
  • Controllers reach out to repositories, get domain objects, and flatten then to DTOs (with Automapper) which are handed to Views.
  • Views have forms which bind back to models that are handed to a "Command Processor" which:
    1. generically takes models
    2. uses reflection to get the "name" of the model type
    3. goes fishing by way of IoC for a handler class for the name which will perform an action
      • the handler will perform a CRUD action based on the model
      • create and edit typically have the same model and the whether-or-not of the Id matching any existing record denotes create vs. edit or the other way around
      • a delete model has just an Id

No comments:

Post a Comment