MVC Controller Architecture Deep Dive. Holistic Look Where do controllers fit?

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Preface Demo A Quick Thank You How Did We Do It?
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
Feature: Identity Management - Login © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
demo Default WANGPSLookup Default WANGPS.
Co- location Mass Market Managed Hosting ISV Hosting.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Multitenant Model Request/Response General Model.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Announcing Demo Announcing.
Feature: OLE Notes Migration Utility
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: SmartList Usability Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Session 1.
Windows Azure Web Sites Speaker Title Organization.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Windows 8 (1) (2) (3) Windows 8 (1) (2) (3)
WinHEC /22/2017 © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Connect with life Connect with life
Windows Azure Connect Name Title Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Suggested Item Enhancements – Sales Script and Additional Information © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: Employee Self Service Timecard Entry © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
announcing Dev Manager Do I understand what we’ve built? Developer Can I bet on using this shared component? Testers What’s changed since I last.
Ian Ellison-Taylor General Manager Microsoft Corporation PC27.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Feature: Suggested Item Enhancements – Analysis and Assignment © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and.
Windows Azure SQL Data Sync Name Title Microsoft Corporation.
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Sr. Dir. – Systems Architecture Inlet Technologies.
public class Foo { Bar _bar; public Foo() { this._bar = new Bar(); } public class Foo { IBar _bar; public Foo(IBar barDependency) {

IoCompleteRequest (Irp);... p = NULL; …f(p);
Ctrl-K, X Ctrl-K, S
DataModel VisualizationExternal Assets Workbook Excel Services API BrowserRich Apps EWA JSOMBrowser REST BrowserRich Apps.
Возможности Excel 2010, о которых следует знать
Title of Presentation 11/22/2018 3:34 PM
Title of Presentation 12/2/2018 3:48 PM
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
Presentation transcript:

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 Model View Controller

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 Workflow Component Model Business Layer DAL Component Gateway Data Access Layer Controller View ViewModel Presentation Layer Crosscutting Concerns

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 DB Workflow Service Data Service Business Service WPF App Console App Web App This is reduced… Public 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 Fine-Grained IEventRepository IAttendeeRepository

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 Workflow Component Model Business Layer DAL Component Gateway Data Access Layer Controller View ViewModel Presentation Layer Crosscutting Concerns

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 Logical Physical Controllers Routes

DEMO Routing

Verbs HTTP Methods AcceptVerbs 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 –ViewResult –JsonResult –ContentResult –EmptyResult –FileResult –HttpUnauthorizedResult

Action Results More Standard actions –JavaScriptResult –RedirectResult –RedirectToRouteResult 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 ControllerBase 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

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.