SlideShare a Scribd company logo
UI Composition
Problemi e “possibili” Soluzioni



Paolo Possanzini
Mauro Servienti
Agenda
• UI Composition
  – Ma pecccchè?
  – I problemi;
  – Le possibili soluzioni;
• Toolkit:
  – cosa offre il mercato;
  – farselo, è pensabile?
È un investimento decisamente onoreso, ne vale la pena?

UI COMPOSITION: PERCHÈ?
Bella domanda...
• Cliente: necessità di modularizzare:
  – Acquistare in configurazioni diverse;
  – Installare in configurazioni diverse;
• Team: necessità di gestire e lavorare:
  – Team grande o distribuito;
  – Soluzione/i di dimensioni ingestibili in VS;
  – Tempi di sviluppo diversi dei “moduli” che non
    devono condizionarsi/bloccarsi a vicenda;
• Un esempio per tutti: Visual Studio;
Ok, chiaro... Ma a che costo?

UI COMPOSITION: I PROBLEMI
Mamma mia...
• ...oltre a tutto quello che M-V-VM si porta
  dietro:
  – Region management;
  – La comunicazione tra attori che non si conoscono;
  – Gestione del ciclo di vita del modulo/plugin;
  – Obbligatorietà di IoC perchè bisogna avere a che
    fare con i contratti... altrimenti ciccia plugin;
Semplicità, adesso è tutto così facile...
            “Region... perchè sei tu region”



                                         Toolbars e Documents sono
                                         Region in cui poter iniettare
                                         contenuti a runtime




                                    xxxDetails è una Region in cui
                                    poter iniettare contenuti
                                    contestuali a runtime
Semplicità...adesso un po’ meno...




Ecco perchè per mettere M-V-VM al centro del
    mondo è necessario sporcarsi le mani
Region: statiche e dinamiche
• Toolbars e Documents sono region “statiche”;
  – Referenziabili per “nome”;
• Ma se avessimo più Window?
    CustomerWindow: Instance 1   CustomerWindow: Instance 2
    “ContentRegion”              “ContentRegion”




• IRegionManager.GetRegion( name ) ?
• svc.RegisterRegion( name, view );
• svc.GetManager( view ).GetRegion( name );
RegionService, RegionManager, Region
• Wpf e Xaml vi danno la massima libertà: lunga
  vita alle Attached Property;
<ContentPresenter
        rg:RegionService.Region="{rg:ContentPresenterRegion 'myRegionName'}"
/>
Come comunicano?


                                                Una toolbar contestuale
l’elemento selezionato deve
                                                compare quando visualizziamo
“attivare” un Command nella
                                                contenuti contestuali
toolbar




                              La variazione di selezione deve
                              essere intercettata per iniettare
                              i contenuti contestuali
Il postino suona sempre 2 volte
• I vari attori, aka Module, non si conoscono ma
  hanno la necessità di comunicare tra loro:
  – Dobbiamo definire una lingua nota a tutti;
  – Dobbiamo designare qualcuno come postino;
Italiani...! La shell si avvia!
• Il nostro postino trasporta messaggi:
  ViewModelLoading<IShellViewModel>()
• che contengono informazioni:
 var regionManager = this.regionService.GetRegionManager( this.View );
 var msg = new ViewModelLoading<IShellViewModel>( this, regionManager );
 this.broker.Dispatch( msg );


• che possiamo usare a nostro uso e consumo:
 this.broker.Subscribe<ViewModelLoading<IShellViewModel>>( this, msg =>
 {
       var viewModel = this.provider.GetService( typeof( IMyContentViewModel ) )
       msg.RegionManager[ "myRegionName" ].Add( viewModel.View );
 } );
... Si ma come è fatto?

ANATOMIA: ...DAL VIVO!
Struttura
• Separazione di contratto e implementazione;
  – ComponentModel;
  – Runtime;
• Ma...qualcuno deve conoscere il tutto:
  – Bootstrapper: è l’equivalente del file di
    configurazione;
Cosa offre il mercato?

TOOLKIT, TOOLKIT E ANCORA
TOOLKIT...
Realizzare un toolkit...
• ... Il gioco vale la candela?
• Che requisiti dobbiamo soddisfare:
   – Gestione delle region;
   – Comunicazione;
   – Gestione del ciclo di vita dei moduli;
• Ma anche (ecco perchè forse ha senso):
   – Un set di ViewModel di base;
   – Un motore di validazione degno del suo nome;
   – Localizzazione;
• e... Silverlight?
... Si m... Io continuo a non capire...

DEMO
Fate i bravi....

NIENTE DOMANDE...? :-)

More Related Content

Viewers also liked

RavenDB in the wild
RavenDB in the wildRavenDB in the wild
RavenDB in the wild
Mauro Servienti
 
Utile e sostenibile
Utile e sostenibileUtile e sostenibile
Utile e sostenibile
Mauro Servienti
 
Introduction to the Particular Platform
Introduction to the Particular PlatformIntroduction to the Particular Platform
Introduction to the Particular Platform
Mauro Servienti
 
NServiceBus - building a distributed system based on a messaging infrastructure
NServiceBus - building a distributed system based on a messaging infrastructureNServiceBus - building a distributed system based on a messaging infrastructure
NServiceBus - building a distributed system based on a messaging infrastructure
Mauro Servienti
 
Dal requisito all'implementazione @ CD2010
Dal requisito all'implementazione @ CD2010Dal requisito all'implementazione @ CD2010
Dal requisito all'implementazione @ CD2010
Mauro Servienti
 
VS Package @ CD2008
VS Package @ CD2008VS Package @ CD2008
VS Package @ CD2008
Mauro Servienti
 
Inversion of Control @ CD2008
Inversion of Control @ CD2008Inversion of Control @ CD2008
Inversion of Control @ CD2008
Mauro Servienti
 
NServiceBus - introduction to a message based distributed architecture
NServiceBus - introduction to a message based distributed architectureNServiceBus - introduction to a message based distributed architecture
NServiceBus - introduction to a message based distributed architecture
Mauro Servienti
 
Croce e delizia del lavoro remoto
Croce e delizia del lavoro remotoCroce e delizia del lavoro remoto
Croce e delizia del lavoro remoto
Mauro Servienti
 
Brokering over WCF @ dotNetMarche
Brokering over WCF @ dotNetMarcheBrokering over WCF @ dotNetMarche
Brokering over WCF @ dotNetMarche
Mauro Servienti
 
On working in Particular
On working in ParticularOn working in Particular
On working in Particular
Mauro Servienti
 
Pub/Sub Basics
Pub/Sub BasicsPub/Sub Basics
Pub/Sub Basics
Mauro Servienti
 
SOA, DDD e microservices
SOA, DDD e microservicesSOA, DDD e microservices
SOA, DDD e microservices
Mauro Servienti
 
THE ROAD TO A SERVICE ORIENTED ARCHITECTURE (SOA)
THE ROAD TO A  SERVICE ORIENTED ARCHITECTURE (SOA)THE ROAD TO A  SERVICE ORIENTED ARCHITECTURE (SOA)
THE ROAD TO A SERVICE ORIENTED ARCHITECTURE (SOA)
Mauro Servienti
 
Silverlight m v-vm @ DotNetteria
Silverlight m v-vm @ DotNetteriaSilverlight m v-vm @ DotNetteria
Silverlight m v-vm @ DotNetteria
Mauro Servienti
 
Services UI composition
Services UI compositionServices UI composition
Services UI composition
Mauro Servienti
 
Single Sign On con IdentityServer
Single Sign On con IdentityServerSingle Sign On con IdentityServer
Single Sign On con IdentityServer
Mauro Servienti
 

Viewers also liked (19)

RavenDB in the wild
RavenDB in the wildRavenDB in the wild
RavenDB in the wild
 
Utile e sostenibile
Utile e sostenibileUtile e sostenibile
Utile e sostenibile
 
Introduction to the Particular Platform
Introduction to the Particular PlatformIntroduction to the Particular Platform
Introduction to the Particular Platform
 
NServiceBus - building a distributed system based on a messaging infrastructure
NServiceBus - building a distributed system based on a messaging infrastructureNServiceBus - building a distributed system based on a messaging infrastructure
NServiceBus - building a distributed system based on a messaging infrastructure
 
Dal requisito all'implementazione @ CD2010
Dal requisito all'implementazione @ CD2010Dal requisito all'implementazione @ CD2010
Dal requisito all'implementazione @ CD2010
 
AngularJS - directives
AngularJS - directivesAngularJS - directives
AngularJS - directives
 
VS Package @ CD2008
VS Package @ CD2008VS Package @ CD2008
VS Package @ CD2008
 
Inversion of Control @ CD2008
Inversion of Control @ CD2008Inversion of Control @ CD2008
Inversion of Control @ CD2008
 
Angular js
Angular jsAngular js
Angular js
 
NServiceBus - introduction to a message based distributed architecture
NServiceBus - introduction to a message based distributed architectureNServiceBus - introduction to a message based distributed architecture
NServiceBus - introduction to a message based distributed architecture
 
Croce e delizia del lavoro remoto
Croce e delizia del lavoro remotoCroce e delizia del lavoro remoto
Croce e delizia del lavoro remoto
 
Brokering over WCF @ dotNetMarche
Brokering over WCF @ dotNetMarcheBrokering over WCF @ dotNetMarche
Brokering over WCF @ dotNetMarche
 
On working in Particular
On working in ParticularOn working in Particular
On working in Particular
 
Pub/Sub Basics
Pub/Sub BasicsPub/Sub Basics
Pub/Sub Basics
 
SOA, DDD e microservices
SOA, DDD e microservicesSOA, DDD e microservices
SOA, DDD e microservices
 
THE ROAD TO A SERVICE ORIENTED ARCHITECTURE (SOA)
THE ROAD TO A  SERVICE ORIENTED ARCHITECTURE (SOA)THE ROAD TO A  SERVICE ORIENTED ARCHITECTURE (SOA)
THE ROAD TO A SERVICE ORIENTED ARCHITECTURE (SOA)
 
Silverlight m v-vm @ DotNetteria
Silverlight m v-vm @ DotNetteriaSilverlight m v-vm @ DotNetteria
Silverlight m v-vm @ DotNetteria
 
Services UI composition
Services UI compositionServices UI composition
Services UI composition
 
Single Sign On con IdentityServer
Single Sign On con IdentityServerSingle Sign On con IdentityServer
Single Sign On con IdentityServer
 

Similar to UI composition @ dotNetMarche

UI Composition
UI CompositionUI Composition
UI Composition
DotNetMarche
 
Never Mind the Bollocks: here's the Domain Driven Design
Never Mind the Bollocks: here's the Domain Driven DesignNever Mind the Bollocks: here's the Domain Driven Design
Never Mind the Bollocks: here's the Domain Driven Design
Andrea Saltarello
 
HTML5, il lato client della forza...
HTML5, il lato client della forza... HTML5, il lato client della forza...
HTML5, il lato client della forza...
Marco Vito Moscaritolo
 
Cac Es3 2009
Cac Es3 2009Cac Es3 2009
Cac Es3 2009
Marco Loregian
 
Introduzione WPF
Introduzione WPFIntroduzione WPF
Introduzione WPF
Ercole Palmeri
 
Introduzione alla programmazione Java
Introduzione alla programmazione JavaIntroduzione alla programmazione Java
Introduzione alla programmazione JavaMassimiliano Brolli
 
Cqrs and IoT: a match made in heaven
Cqrs and IoT: a match made in heavenCqrs and IoT: a match made in heaven
Cqrs and IoT: a match made in heaven
Carmine Ingaldi
 
#LRIS2014 - MessageBus, Cluster communication and Caching on B2B
#LRIS2014 - MessageBus, Cluster communication and Caching on B2B#LRIS2014 - MessageBus, Cluster communication and Caching on B2B
#LRIS2014 - MessageBus, Cluster communication and Caching on B2B
kino2k
 
Aruba Cloud: 5 minuti sul VisualCloud #Arubait5
Aruba Cloud: 5 minuti sul VisualCloud #Arubait5Aruba Cloud: 5 minuti sul VisualCloud #Arubait5
Aruba Cloud: 5 minuti sul VisualCloud #Arubait5
Aruba S.p.A.
 
Html5
Html5Html5
MySQL Day Roma 2019 - Le architetture a microservizi e MySQL
MySQL Day Roma 2019 - Le architetture a microservizi e MySQLMySQL Day Roma 2019 - Le architetture a microservizi e MySQL
MySQL Day Roma 2019 - Le architetture a microservizi e MySQL
Par-Tec S.p.A.
 
Smau milano 2012 massimiliano del cero
Smau milano 2012 massimiliano del ceroSmau milano 2012 massimiliano del cero
Smau milano 2012 massimiliano del ceroSMAU
 
Introduzione a Service Fabric e Actor Model
Introduzione a Service Fabric e Actor ModelIntroduzione a Service Fabric e Actor Model
Introduzione a Service Fabric e Actor Model
Andrea Tosato
 
Introduzione al Domain Driven Design (DDD)
Introduzione al Domain Driven Design (DDD)Introduzione al Domain Driven Design (DDD)
Introduzione al Domain Driven Design (DDD)
DotNetMarche
 
IaC - Infrastructure as Code, gestire infrastrutture cloud tramite file di co...
IaC - Infrastructure as Code, gestire infrastrutture cloud tramite file di co...IaC - Infrastructure as Code, gestire infrastrutture cloud tramite file di co...
IaC - Infrastructure as Code, gestire infrastrutture cloud tramite file di co...
Daniele Mondello
 
5 - Introduzione al Web (2/2)
5 - Introduzione al Web (2/2)5 - Introduzione al Web (2/2)
5 - Introduzione al Web (2/2)
Giuseppe Vizzari
 
Introduzione al web (2/2) - 18/19
Introduzione al web (2/2) - 18/19Introduzione al web (2/2) - 18/19
Introduzione al web (2/2) - 18/19
Giuseppe Vizzari
 
Sistemi Context-aware: Esercitazione 3
Sistemi Context-aware: Esercitazione 3Sistemi Context-aware: Esercitazione 3
Sistemi Context-aware: Esercitazione 3
Marco Loregian
 

Similar to UI composition @ dotNetMarche (20)

UI Composition
UI CompositionUI Composition
UI Composition
 
Never Mind the Bollocks: here's the Domain Driven Design
Never Mind the Bollocks: here's the Domain Driven DesignNever Mind the Bollocks: here's the Domain Driven Design
Never Mind the Bollocks: here's the Domain Driven Design
 
HTML5, il lato client della forza...
HTML5, il lato client della forza... HTML5, il lato client della forza...
HTML5, il lato client della forza...
 
#dd12 Domino e DB2
#dd12 Domino e DB2#dd12 Domino e DB2
#dd12 Domino e DB2
 
Cac Es3 2009
Cac Es3 2009Cac Es3 2009
Cac Es3 2009
 
Introduzione WPF
Introduzione WPFIntroduzione WPF
Introduzione WPF
 
Corba
CorbaCorba
Corba
 
Introduzione alla programmazione Java
Introduzione alla programmazione JavaIntroduzione alla programmazione Java
Introduzione alla programmazione Java
 
Cqrs and IoT: a match made in heaven
Cqrs and IoT: a match made in heavenCqrs and IoT: a match made in heaven
Cqrs and IoT: a match made in heaven
 
#LRIS2014 - MessageBus, Cluster communication and Caching on B2B
#LRIS2014 - MessageBus, Cluster communication and Caching on B2B#LRIS2014 - MessageBus, Cluster communication and Caching on B2B
#LRIS2014 - MessageBus, Cluster communication and Caching on B2B
 
Aruba Cloud: 5 minuti sul VisualCloud #Arubait5
Aruba Cloud: 5 minuti sul VisualCloud #Arubait5Aruba Cloud: 5 minuti sul VisualCloud #Arubait5
Aruba Cloud: 5 minuti sul VisualCloud #Arubait5
 
Html5
Html5Html5
Html5
 
MySQL Day Roma 2019 - Le architetture a microservizi e MySQL
MySQL Day Roma 2019 - Le architetture a microservizi e MySQLMySQL Day Roma 2019 - Le architetture a microservizi e MySQL
MySQL Day Roma 2019 - Le architetture a microservizi e MySQL
 
Smau milano 2012 massimiliano del cero
Smau milano 2012 massimiliano del ceroSmau milano 2012 massimiliano del cero
Smau milano 2012 massimiliano del cero
 
Introduzione a Service Fabric e Actor Model
Introduzione a Service Fabric e Actor ModelIntroduzione a Service Fabric e Actor Model
Introduzione a Service Fabric e Actor Model
 
Introduzione al Domain Driven Design (DDD)
Introduzione al Domain Driven Design (DDD)Introduzione al Domain Driven Design (DDD)
Introduzione al Domain Driven Design (DDD)
 
IaC - Infrastructure as Code, gestire infrastrutture cloud tramite file di co...
IaC - Infrastructure as Code, gestire infrastrutture cloud tramite file di co...IaC - Infrastructure as Code, gestire infrastrutture cloud tramite file di co...
IaC - Infrastructure as Code, gestire infrastrutture cloud tramite file di co...
 
5 - Introduzione al Web (2/2)
5 - Introduzione al Web (2/2)5 - Introduzione al Web (2/2)
5 - Introduzione al Web (2/2)
 
Introduzione al web (2/2) - 18/19
Introduzione al web (2/2) - 18/19Introduzione al web (2/2) - 18/19
Introduzione al web (2/2) - 18/19
 
Sistemi Context-aware: Esercitazione 3
Sistemi Context-aware: Esercitazione 3Sistemi Context-aware: Esercitazione 3
Sistemi Context-aware: Esercitazione 3
 

More from Mauro Servienti

Welcome to the (state) machine @ ExploreDDD 2019
Welcome to the (state) machine @ ExploreDDD 2019Welcome to the (state) machine @ ExploreDDD 2019
Welcome to the (state) machine @ ExploreDDD 2019
Mauro Servienti
 
Designing a ui for microservices @ .NET Day Switzerland 2019
Designing a ui for microservices @ .NET Day Switzerland 2019Designing a ui for microservices @ .NET Day Switzerland 2019
Designing a ui for microservices @ .NET Day Switzerland 2019
Mauro Servienti
 
Welcome to the (state) machine @ Xe One Day Enterprise Applications
Welcome to the (state) machine @ Xe One Day Enterprise ApplicationsWelcome to the (state) machine @ Xe One Day Enterprise Applications
Welcome to the (state) machine @ Xe One Day Enterprise Applications
Mauro Servienti
 
All our aggregates are wrong @ NDC Copenhagen 2019
All our aggregates are wrong @ NDC Copenhagen 2019All our aggregates are wrong @ NDC Copenhagen 2019
All our aggregates are wrong @ NDC Copenhagen 2019
Mauro Servienti
 
Be like water, my friend @ Agile for Innovation 2019
Be like water, my friend @ Agile for Innovation 2019Be like water, my friend @ Agile for Innovation 2019
Be like water, my friend @ Agile for Innovation 2019
Mauro Servienti
 
Microservices architecture is it the right choice to design long-living syste...
Microservices architecture is it the right choice to design long-living syste...Microservices architecture is it the right choice to design long-living syste...
Microservices architecture is it the right choice to design long-living syste...
Mauro Servienti
 
Titles, abstracts, and bio matter... oh my! @ Global Diversity CFP Day 2019
Titles, abstracts, and bio matter... oh my! @ Global Diversity CFP Day 2019Titles, abstracts, and bio matter... oh my! @ Global Diversity CFP Day 2019
Titles, abstracts, and bio matter... oh my! @ Global Diversity CFP Day 2019
Mauro Servienti
 
Living organizations, particular software @ do IT Better Parma
Living organizations, particular software @ do IT Better ParmaLiving organizations, particular software @ do IT Better Parma
Living organizations, particular software @ do IT Better Parma
Mauro Servienti
 
Welcome to the (state) machine @ Crafted Software
Welcome to the (state) machine @ Crafted SoftwareWelcome to the (state) machine @ Crafted Software
Welcome to the (state) machine @ Crafted Software
Mauro Servienti
 
PO is dead, long live the PO - Italian Agile Day 2018
PO is dead, long live the PO - Italian Agile Day 2018PO is dead, long live the PO - Italian Agile Day 2018
PO is dead, long live the PO - Italian Agile Day 2018
Mauro Servienti
 
Design a UI for your Microservices @ Do IT Better
Design a UI for your Microservices @ Do IT BetterDesign a UI for your Microservices @ Do IT Better
Design a UI for your Microservices @ Do IT Better
Mauro Servienti
 
Microservices and pineapple on pizza what do they have in common - dos and ...
Microservices and pineapple on pizza   what do they have in common - dos and ...Microservices and pineapple on pizza   what do they have in common - dos and ...
Microservices and pineapple on pizza what do they have in common - dos and ...
Mauro Servienti
 
All our aggregates are wrong (ExploreDDD 2018)
All our aggregates are wrong (ExploreDDD 2018)All our aggregates are wrong (ExploreDDD 2018)
All our aggregates are wrong (ExploreDDD 2018)
Mauro Servienti
 
Designing a ui for microservices
Designing a ui for microservicesDesigning a ui for microservices
Designing a ui for microservices
Mauro Servienti
 
Po is dead, long live the po
Po is dead, long live the poPo is dead, long live the po
Po is dead, long live the po
Mauro Servienti
 
Shipping code is not the problem, deciding what to ship it is!
Shipping code is not the problem, deciding what to ship it is!Shipping code is not the problem, deciding what to ship it is!
Shipping code is not the problem, deciding what to ship it is!
Mauro Servienti
 
GraphQL - Where are you from? Where are you going?
GraphQL - Where are you from? Where are you going?GraphQL - Where are you from? Where are you going?
GraphQL - Where are you from? Where are you going?
Mauro Servienti
 
Dall'idea al deploy un lungo viaggio che passa per git flow e semver
Dall'idea al deploy   un lungo viaggio che passa per git flow e semverDall'idea al deploy   un lungo viaggio che passa per git flow e semver
Dall'idea al deploy un lungo viaggio che passa per git flow e semver
Mauro Servienti
 
Progettare una UI per i Microservices
Progettare una UI per i MicroservicesProgettare una UI per i Microservices
Progettare una UI per i Microservices
Mauro Servienti
 
The road to a Service Oriented Architecture is paved with messages
The road to a Service Oriented Architecture is paved with messagesThe road to a Service Oriented Architecture is paved with messages
The road to a Service Oriented Architecture is paved with messages
Mauro Servienti
 

More from Mauro Servienti (20)

Welcome to the (state) machine @ ExploreDDD 2019
Welcome to the (state) machine @ ExploreDDD 2019Welcome to the (state) machine @ ExploreDDD 2019
Welcome to the (state) machine @ ExploreDDD 2019
 
Designing a ui for microservices @ .NET Day Switzerland 2019
Designing a ui for microservices @ .NET Day Switzerland 2019Designing a ui for microservices @ .NET Day Switzerland 2019
Designing a ui for microservices @ .NET Day Switzerland 2019
 
Welcome to the (state) machine @ Xe One Day Enterprise Applications
Welcome to the (state) machine @ Xe One Day Enterprise ApplicationsWelcome to the (state) machine @ Xe One Day Enterprise Applications
Welcome to the (state) machine @ Xe One Day Enterprise Applications
 
All our aggregates are wrong @ NDC Copenhagen 2019
All our aggregates are wrong @ NDC Copenhagen 2019All our aggregates are wrong @ NDC Copenhagen 2019
All our aggregates are wrong @ NDC Copenhagen 2019
 
Be like water, my friend @ Agile for Innovation 2019
Be like water, my friend @ Agile for Innovation 2019Be like water, my friend @ Agile for Innovation 2019
Be like water, my friend @ Agile for Innovation 2019
 
Microservices architecture is it the right choice to design long-living syste...
Microservices architecture is it the right choice to design long-living syste...Microservices architecture is it the right choice to design long-living syste...
Microservices architecture is it the right choice to design long-living syste...
 
Titles, abstracts, and bio matter... oh my! @ Global Diversity CFP Day 2019
Titles, abstracts, and bio matter... oh my! @ Global Diversity CFP Day 2019Titles, abstracts, and bio matter... oh my! @ Global Diversity CFP Day 2019
Titles, abstracts, and bio matter... oh my! @ Global Diversity CFP Day 2019
 
Living organizations, particular software @ do IT Better Parma
Living organizations, particular software @ do IT Better ParmaLiving organizations, particular software @ do IT Better Parma
Living organizations, particular software @ do IT Better Parma
 
Welcome to the (state) machine @ Crafted Software
Welcome to the (state) machine @ Crafted SoftwareWelcome to the (state) machine @ Crafted Software
Welcome to the (state) machine @ Crafted Software
 
PO is dead, long live the PO - Italian Agile Day 2018
PO is dead, long live the PO - Italian Agile Day 2018PO is dead, long live the PO - Italian Agile Day 2018
PO is dead, long live the PO - Italian Agile Day 2018
 
Design a UI for your Microservices @ Do IT Better
Design a UI for your Microservices @ Do IT BetterDesign a UI for your Microservices @ Do IT Better
Design a UI for your Microservices @ Do IT Better
 
Microservices and pineapple on pizza what do they have in common - dos and ...
Microservices and pineapple on pizza   what do they have in common - dos and ...Microservices and pineapple on pizza   what do they have in common - dos and ...
Microservices and pineapple on pizza what do they have in common - dos and ...
 
All our aggregates are wrong (ExploreDDD 2018)
All our aggregates are wrong (ExploreDDD 2018)All our aggregates are wrong (ExploreDDD 2018)
All our aggregates are wrong (ExploreDDD 2018)
 
Designing a ui for microservices
Designing a ui for microservicesDesigning a ui for microservices
Designing a ui for microservices
 
Po is dead, long live the po
Po is dead, long live the poPo is dead, long live the po
Po is dead, long live the po
 
Shipping code is not the problem, deciding what to ship it is!
Shipping code is not the problem, deciding what to ship it is!Shipping code is not the problem, deciding what to ship it is!
Shipping code is not the problem, deciding what to ship it is!
 
GraphQL - Where are you from? Where are you going?
GraphQL - Where are you from? Where are you going?GraphQL - Where are you from? Where are you going?
GraphQL - Where are you from? Where are you going?
 
Dall'idea al deploy un lungo viaggio che passa per git flow e semver
Dall'idea al deploy   un lungo viaggio che passa per git flow e semverDall'idea al deploy   un lungo viaggio che passa per git flow e semver
Dall'idea al deploy un lungo viaggio che passa per git flow e semver
 
Progettare una UI per i Microservices
Progettare una UI per i MicroservicesProgettare una UI per i Microservices
Progettare una UI per i Microservices
 
The road to a Service Oriented Architecture is paved with messages
The road to a Service Oriented Architecture is paved with messagesThe road to a Service Oriented Architecture is paved with messages
The road to a Service Oriented Architecture is paved with messages
 

UI composition @ dotNetMarche

  • 1. UI Composition Problemi e “possibili” Soluzioni Paolo Possanzini Mauro Servienti
  • 2. Agenda • UI Composition – Ma pecccchè? – I problemi; – Le possibili soluzioni; • Toolkit: – cosa offre il mercato; – farselo, è pensabile?
  • 3. È un investimento decisamente onoreso, ne vale la pena? UI COMPOSITION: PERCHÈ?
  • 4. Bella domanda... • Cliente: necessità di modularizzare: – Acquistare in configurazioni diverse; – Installare in configurazioni diverse; • Team: necessità di gestire e lavorare: – Team grande o distribuito; – Soluzione/i di dimensioni ingestibili in VS; – Tempi di sviluppo diversi dei “moduli” che non devono condizionarsi/bloccarsi a vicenda; • Un esempio per tutti: Visual Studio;
  • 5. Ok, chiaro... Ma a che costo? UI COMPOSITION: I PROBLEMI
  • 6. Mamma mia... • ...oltre a tutto quello che M-V-VM si porta dietro: – Region management; – La comunicazione tra attori che non si conoscono; – Gestione del ciclo di vita del modulo/plugin; – Obbligatorietà di IoC perchè bisogna avere a che fare con i contratti... altrimenti ciccia plugin;
  • 7. Semplicità, adesso è tutto così facile... “Region... perchè sei tu region” Toolbars e Documents sono Region in cui poter iniettare contenuti a runtime xxxDetails è una Region in cui poter iniettare contenuti contestuali a runtime
  • 8. Semplicità...adesso un po’ meno... Ecco perchè per mettere M-V-VM al centro del mondo è necessario sporcarsi le mani
  • 9. Region: statiche e dinamiche • Toolbars e Documents sono region “statiche”; – Referenziabili per “nome”; • Ma se avessimo più Window? CustomerWindow: Instance 1 CustomerWindow: Instance 2 “ContentRegion” “ContentRegion” • IRegionManager.GetRegion( name ) ? • svc.RegisterRegion( name, view ); • svc.GetManager( view ).GetRegion( name );
  • 10. RegionService, RegionManager, Region • Wpf e Xaml vi danno la massima libertà: lunga vita alle Attached Property; <ContentPresenter rg:RegionService.Region="{rg:ContentPresenterRegion 'myRegionName'}" />
  • 11. Come comunicano? Una toolbar contestuale l’elemento selezionato deve compare quando visualizziamo “attivare” un Command nella contenuti contestuali toolbar La variazione di selezione deve essere intercettata per iniettare i contenuti contestuali
  • 12. Il postino suona sempre 2 volte • I vari attori, aka Module, non si conoscono ma hanno la necessità di comunicare tra loro: – Dobbiamo definire una lingua nota a tutti; – Dobbiamo designare qualcuno come postino;
  • 13. Italiani...! La shell si avvia! • Il nostro postino trasporta messaggi: ViewModelLoading<IShellViewModel>() • che contengono informazioni: var regionManager = this.regionService.GetRegionManager( this.View ); var msg = new ViewModelLoading<IShellViewModel>( this, regionManager ); this.broker.Dispatch( msg ); • che possiamo usare a nostro uso e consumo: this.broker.Subscribe<ViewModelLoading<IShellViewModel>>( this, msg => { var viewModel = this.provider.GetService( typeof( IMyContentViewModel ) ) msg.RegionManager[ "myRegionName" ].Add( viewModel.View ); } );
  • 14. ... Si ma come è fatto? ANATOMIA: ...DAL VIVO!
  • 15. Struttura • Separazione di contratto e implementazione; – ComponentModel; – Runtime; • Ma...qualcuno deve conoscere il tutto: – Bootstrapper: è l’equivalente del file di configurazione;
  • 16. Cosa offre il mercato? TOOLKIT, TOOLKIT E ANCORA TOOLKIT...
  • 17. Realizzare un toolkit... • ... Il gioco vale la candela? • Che requisiti dobbiamo soddisfare: – Gestione delle region; – Comunicazione; – Gestione del ciclo di vita dei moduli; • Ma anche (ecco perchè forse ha senso): – Un set di ViewModel di base; – Un motore di validazione degno del suo nome; – Localizzazione; • e... Silverlight?
  • 18. ... Si m... Io continuo a non capire... DEMO
  • 19. Fate i bravi.... NIENTE DOMANDE...? :-)