Orchard CMS: architettura

26
Architettura di Orchard uno sguardo dietro le quinte… Michele Aponte Microsoft MVP ASP.NET / IIS MCT – MCP – MCTS – MCPD [email protected] http://dotnetcampania.org/blogs/ michele [email protected] Associazione Culturale DotNetCampania

description

Dopo una panoramica sul funzionamento di base di Orchard diamo uno sguardo al suo codice, scoprendo dietro le quinte un motore basato su tecnologie allo stato dell’arte, rinunciando in qualche caso anche alla produzione propria come per la persistenza dei dati in cui NHibernate è stato preferito a Entity Framework. Daremo insieme uno sguardo al codice sorgente disponibile liberamente su Codeplex gettando le basi necessarie a capire come sviluppare un modulo aggiuntivo per questo ottimo CMS.

Transcript of Orchard CMS: architettura

Page 1: Orchard CMS: architettura

Architettura di Orcharduno sguardo dietro le quinte…

Michele AponteMicrosoft MVP ASP.NET / IISMCT – MCP – MCTS – [email protected]

http://dotnetcampania.org/blogs/[email protected]

Associazione Culturale DotNetCampania

Page 2: Orchard CMS: architettura

Architettura

Page 3: Orchard CMS: architettura

Architettura

Page 4: Orchard CMS: architettura

Architettura

Page 5: Orchard CMS: architettura

Architettura

View

Controller

Model

Page 6: Orchard CMS: architettura

Architettura

Request

UrlRouting

Controller

Action Action Result

View Result

http://www.miaapplicazione.it/{controller}/{action}/{param}

Page 7: Orchard CMS: architettura

Architettura

www.miaapplicazione.it/

News/Show/10

UrlRouting

NewsController

Show(10)Action Result

Show Result

http://www.miaapplicazione.it/News/Show/10

Page 8: Orchard CMS: architettura

Architettura

Page 9: Orchard CMS: architettura

Architettura NHibernate

Page 10: Orchard CMS: architettura

Architettura NHibernate

DB

Class

ORM

Relazionale

Oggetti

Class

Class Class

Page 11: Orchard CMS: architettura

Architettura NHibernate

DB

Class

ORM

Relazionale

Oggetti

Class

Class Class

Page 12: Orchard CMS: architettura

Architettura

NHibernate

Page 13: Orchard CMS: architettura

Architettura Autofac

NHibernate

IoC Container

Class1 Class 2

Page 14: Orchard CMS: architettura

Architettura

Autofac NHibernate

Page 15: Orchard CMS: architettura

Architettura

Autofac

Castle

NHibernate

Class1 Class 2

Dynamic Proxy Generator

Page 16: Orchard CMS: architettura

Architettura

Autofac

Castle

NHibernate

Class1 Class 2ProxyClass 2

Dynamic Proxy Generator

Page 18: Orchard CMS: architettura

Architettura

Autofac Castle NHibernate

Orchard Framework

Page 19: Orchard CMS: architettura

Architettura

Autofac Castle NHibernate

Orchard Framework

Core

Page 20: Orchard CMS: architettura

Architettura

Autofac Castle NHibernate

Orchard Framework

Core

Moduli

Page 21: Orchard CMS: architettura

Architettura

Autofac Castle NHibernate

Orchard Framework

Core

Moduli

Page 22: Orchard CMS: architettura

Funzionamento di un modulo

Orchard Framework

ContentManager• Query• CRUD• BuildDisplay

Localization

Events

Messaging

Indexing

Logging Reports

Services Tasks

SettingsCommand

s

Security Caching

Moduli

Model Controller View

ViewDriver

s

Handlers

Controller

Placement

DB

Records

Migrations

Definitions:

Types, Parts, & Fields

Data:Content Items

ORM

Relational Domain

Shapes

Events

Request Response

Page 23: Orchard CMS: architettura

Data Composition

ContentManager(CRUD)

ContentItem

ContentHandler 1

ContentHandler 2

ContentHandler N

(…)ContentPart 1

ContentPart 2

(…)

ContentPart N

Page 24: Orchard CMS: architettura

Funzionamento di un modulo

ContentManager(BuildXxxModel)

ContentItemViewModel

ContentDriverPart 1

ContentDriverPart 2

ContentDriverPart n

(…)

View

Controller

Page 25: Orchard CMS: architettura

DemoAnalisi del codice sorgente di Orchard

Page 26: Orchard CMS: architettura

© 2009 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.