MVC Controller Architecture Deep Dive Holistic Look Where
- Slides: 46
MVC Controller Architecture Deep Dive
Holistic Look Where do controllers fit?
Simple Application • A web site • Abstraction costs higher than return • Does not integrate with business processes • Solo project
Simple Application Controller is the life of this app!
Simple Application Controller View Model
Layered Application • • More thought placed in design Integrates into larger infrastructures Abstraction necessary for reuse Team project
Layered Application Controller is the public interface
Layered Application Presentation Layer View Controller Business Layer Workflow Component Model Data Access Layer DAL Component Gateway Crosscutting Concerns View. Model
Enterprise Application • Complexity determined by business needs – But strive for simplicity • And reusability • Will integrate into larger infrastructure
Enterprise Application Controller is still the public interface
Enterprise Application BUT
Enterprise Application It may be the life of an app if small…
Enterprise Application This is reduced… WPF App Business Service Public Service Console App Data Service DB Web App Workflow Service
Enterprise Application It probably looks like this. . .
The Controller Designing the perfect cog
Question Should I use repositories?
Should I Use Repositories? Yes
Should I Use Repositories? Only composition logic Encapsulate and abstract other logic
DEMO Encapsulation is simple
Question Do I need one repository per model?
One Repository Per Model? No
One Repository Per Model? Probably
Repository Style Coarse-Grained IEvent. Repository Fine-Grained IEvent. Repository IAttendee. Repository
Question How do I transition to n-tier?
Transition to n-tier? Easier
Transition to n-tier? If you followed my previous recommendations
Breaking It Up Presentation Layer View Controller Business Layer Workflow Component Model Data Access Layer DAL Component Gateway Crosscutting Concerns View. Model
DEMO Moving to a tier Without affecting your Controller!!!
Considerations • • Flexibility Maintainability Related entities Are you using more than one repository per controller?
The Controller • • • Routing Verbs Action Results Standard Controllers Custom Controllers
Routing • • HTTP Request web. config Global. asax Favor Resources
Routing Physical Controllers Logical Routes
DEMO Routing
Verbs • HTTP Methods • Accept. Verbs Attribute • RESTful CRUD – GET – PUT – POST – DELETE
Verbs • • • HEAD OPTIONS CONNECT TRACE Custom Verbs
DEMO Verbs
Action Results • Controllers do something when called • Standard action results – View. Result – Json. Result – Content. Result – Empty. Result – File. Result – Http. Unauthorized. Result
Action Results • More Standard actions – Java. Script. Result – Redirect. To. Route. Result • Make your own!
DEMO Custom Action Results
Standard Controllers • Great for standard web applications • Convention-based – Even non-standard controllers are convention based when used with views
Custom Controllers • • Can decorate the standard class Can inherit from Controller. Base Can implement IController Use for non-standard applications – or for more control
DEMO Custom Controllers
Controller as a Service • • MVC apps are typically web sites They can also be web services Do you have a mixed site/service? It can also be a pure service without JSON
DEMO Controller as a Service
Resources Software Application Developers Infrastructure Professionals http: //msdn. microsoft. com/ http: //technet. microsoft. com/ msdnindia @msdnindia technetindia @technetindia
© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U. S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
- Look up, look down, look all around
- Partial view in mvc
- To dive deeper synonym
- Words related to mystery and suspense
- Pears deep dive
- Linux deep dive
- Azure networking deep dive
- Azure cosmos db: sql api deep dive online courses
- Deep dive icon
- Mvc architecture in jsp
- Java swing mvc
- Deep asleep deep asleep it lies
- Deep forest: towards an alternative to deep neural networks
- 深哉深哉
- Programmed i/o in computer architecture
- Ddr
- Mammalian dive reflex
- Nitrox mod table
- I can prevent most surface emergencies (problems) by
- Forsyth central swim and dive
- Orm worksheet
- Flexbone offense plays
- Dive rule hashcat
- How to use recreational dive planner
- Shakopee girls swim and dive
- Klein oak swim and dive
- Dive physiology
- Dive planning software
- Activity 1 a look at the picture
- Look at the picture in activity 1
- Look at the picture in activity
- Anat bremler-barr
- Deep packet inspection architecture
- Spring bean lifecycle
- Blackboard mvc
- Mvc muster
- Controller pattern
- Trygve reenskaug mvc
- Jee mvc
- What mvc stands for
- Mvc pattern java
- Mvc-mis
- Mvc vs webforms
- Swing mvc example
- Mvt vs mvc
- Wzorzec projektowy mvc
- Mvc paradigm