Silverlight 4 Reference Architecture for LOB apps
-
Upload
dennis-doomen -
Category
Technology
-
view
3.640 -
download
1
description
Transcript of Silverlight 4 Reference Architecture for LOB apps
© 2010 Aviva Solutions 8 april 2023
A Silverlight 4 Reference Architecturefor Line-of-Business Applications
Dennis Doomen
© 2010 Aviva Solutions 8 april 2023Dennis Doomen
Requirements• Testable• Pragmatic• Single Responsibility Principle• Dependency Injection• Don’t DIY• …whatever your project requires
© 2010 Aviva Solutions 8 april 2023
The traditional architecture…
© 2010 Aviva Solutions 8 april 2023
Service Agent
DTOs
View Models
Views (XAML + C#)
Domain Model
Repositories
Database
NHibernate
(+ Fluen
t & LINQ)
WCF
Silverlight 4
Unit-of-Work Service Agents
Shell
Backoffice System
Application Controller
Service Interface
Workflows
External Service
Service Actions
Well-known Rich domain models Many frameworks Very flexibele× Lots of work× Lots of plumbing needed× Not using RIA frameworks× DTO conversion troubles× No eager loading
© 2010 Aviva Solutions 8 april 2023Dennis Doomen
Model View-ViewModel
XAML (+C#) ViewModel
Model
ServiceAgent
INotifyPropertyChanged
Loads
Events
{Binding}
CommandCall
© 2010 Aviva Solutions 8 april 2023
As Microsoft wants it…
© 2010 Aviva Solutions 8 april 2023
Domain Context
Changesets
View Models
Views (XAML + C#)
Entities
Database
WCF RIA Services
Silverlight 4
Entity Framework Service Agents
Shell
Backoffice System
Application Controller
Domain Service
External Service
Easy to build Simple domain models Less plumbing needed No DTO conversions needed Maximizes RIA frameworks Great for CRUD Batching× CRUD-based× Domain model not possible× No dynamic relationship
loading× No enum support
Business Actions
© 2010 Aviva Solutions 8 april 2023
Entity Framework and WCF RIA Services?
© 2010 Aviva Solutions 8 april 2023Dennis Doomen
WCF RIA Services Client-side Validation Automatic change-tracking Client-side LINQ Code Sharing Great for CRUD i.c.m. Entity Framework Built-in authorization OData support WCF based× No rich domain models× No eager loading× No enum support× Not persistency ignorant
© 2010 Aviva Solutions 8 april 2023Dennis Doomen
Entity Framework Great designer environment Code Sharing Fluent interface POCO support Great integration with WCF RIA/Data Mapping attributes× Mapping attributes× No free support for other vendors× No enum support× No 2nd level caching
© 2010 Aviva Solutions 8 april 2023
Then what?
© 2010 Aviva Solutions 8 april 2023
Service Agent
DTOs
View Models
Views (XAML + C#)
Domain Model
Repositories
Command Handlers
Database
NHibernate
(+ Fluen
t & LINQ)
WCF Data Services
Silverlight 4
Unit of Work Service Agents
Domain Events
Policy Injection
Logging
Shell
Bootstrapper
Caliburn Micro
Unity 2 of M
EF
Unity 2 or M
EF
Coroutines
Enterprise Library 5
Backoffice System
Application Controller
Command Service
Commands
Event Handlers
Rest Service
Workflows
External Service
Service Actions
© 2010 Aviva Solutions 8 april 2023Dennis Doomen
WCF Data Services Client-side LINQ Automatic change-tracking Great for querying OData support Eager loading Projections WCF based× Built-in authorization× Code Sharing× Client-side Validation× Rich domain models
© 2010 Aviva Solutions 8 april 2023
Commanding
© 2010 Aviva Solutions 8 april 2023
Domain Events
© 2010 Aviva Solutions 8 april 2023
Background InformationMVVM, Coroutines, Commanding, Querying, Domain Events, Testable Repository Pattern
Example Code, FrameworksThe CQRS Kitchen, Caliburn Micro, MEF, Unity 2, NHibernate, Fluent NHibernate, Fluent Assertions