The document discusses building enterprise software with a 'cloud ready' design using an application infrastructure. It advocates separating the core application from frameworks through modularity, abstraction, and encapsulation. This allows the application to be deployed both on-premises and to the cloud in a gradual, non-disruptive manner. The application infrastructure enforces this architecture, providing features like dependency injection, isolation of data access concerns, and logging abstractions to manage complexity and scale across environments.
4. Re-Implement on a Modern Architecture
Legacy System
• High costs to update
• Shetty UX
• Outdated functionalities
• Not scalable, not reliable
Modern System
• Accessible everywhere
• Actual technologies
• Good maintainability
4
6. Build and Operate for On-Premises
Deployable in Azure
Enable a gradual migration into the Cloud
Cloud migration does not require a
rewrite or reengineering
First phase use IaaS
Second phase use PaaS
Quality
Isolation
Separation
Build, Test and
Deploy for
On-Premises
only
Large and
Complex
System
Deployable on
Azure
Use PaaS
6
7. Source code dependencies can only
point inwards
• Nothing in an inner circle can know anything
at all about something in an outer circle
• Abstractions and application concepts are
independent of frameworks
• frameworks are used as tools, not to cram the
system into their limiting constraints
7
http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
Separate the core of the app from
the frameworks and the mechanisms
8. What did we already do?
8
Design
Envision
solutions
Setup rules
and practices
Managing
Complexity
Quality
Change
Separations
Abstraction &
Encapsulation
Explain &
Validate
Diagrams Prototypes
9. Importance of Managing Complexity
when projects do fail for reasons that are primarily
technical, the reason is often
uncontrolled complexity
9
10. Importance of Managing Complexity
Scalability
Availability
Multitenancy
Security
Authorization
18. How to do it?
Invest in Design and App. Infrastructure
Enforce consistency
Enforce structure
Focus on Modularity, Abstraction, Encapsulation
Independent
Modules
Hide the
frameworks
Manage Dependencies
Dependency
Injection
Discoverability
18
19. Good Design vs Bad Design
http://martinfowler.com/bliki/DesignStaminaHypothesis.html
20. iQuarc AppBoot Library
Lightweight library that handles the startup of an application
Implements
Separation of Construction
and Configuration from Use
Modularity
Defines and abstracts a
modular application
Makes the application
independent of the host
process
Dependencies Management
Dependency Injection
Enforces consistency in
declaring dependencies
Encourages good practices
Encourages separation
between data and behavior
20
21. iQuarc AppBoot: Modularity
<<Interface>>
IModule
+ Initialize()
Application
+ Initialize()
*
+ Modules[]
AppModule1
+ Initialize()
AppModule2
+ Initialize()
• Modular Application Support
• Application modules do not depend on
Frameworks
• Application can be hosted in any .NET process
iQuarcAppBoot
22. Application Hosted in Any .NET Process
• The application is not aware of the process it is
hosted in
• The application is isolated from framework specifics
• The host process is not aware of what modules it
hosts
• The host process is isolated from application logic
• Benefits:
• Flexible deployments
o same host can load different modules depending on
configuration
o Flexibility in development and testing
• Framework setup is separated from application setup
22
<<Attribute>>
ServiceAttribute
+ ServiceAttribute()
+ServiceAttribute(Type contract)
+ ServiceAttribute(Type t, Lifetime lifetime)
Bootstrapper
+Bootstrapper(Assembly[] assemblies)
+Run()
Application
+ Initialize()
iQuarcAppBoot
23. App Boot: Dependency Injection
<<Attribute>>
ServiceAttribute
+ ServiceAttribute()
+ServiceAttribute(Type contract)
+ ServiceAttribute(Type t, Lifetime lifetime)
Bootstrapper
+Bootstrapper(Assembly[] assemblies)
+Run()
• Makes Programming Against Interfaces the de
facto programming model
• Abstracts and hides the Dependency
Container
• Provides a maintainable mechanism for
declaring services implementation
• Dictates how Dependency Injection is used
iQuarcAppBoot
24. public IEnumerable<Policy> GetPolicyFromMutation(Mutation mut)
{
var policies = repository.GetEntities<PolicyImage>()
.Where(image => image.MutationId==mut.Id)
.Select(image => new Policy
{
Id = image.PolicyId,
ValidAt = image.Mutation.Date
//..
}).ToList();
// do other calculations / grouping on data
return policies;
}
public void CalculateChanges(ChangeEvent change)
{
using (var uof = repository.CreateUnitOfWork())
{
var policies = uof.GetEntities<PolicyImage>()
.Where(i => i.Status == ImageStatus.Calculating &&
. i.EvendId == change.Id);
foreach (PolicyImage image in policies)
{
image.Ammunt = GetAmmountFor(image, change);
}
uof.SaveChanges();
}
}
Encapsulate Data Access Concerns
<<Interface>>
IRepository
+GetEntities<T>() : IQueriable<T>
<<Interface>>
IUnitOfWork
+SaveChanges()
Database
Repository UnitOfWork
<<Stereotype>>
<<DTO>>
Plan
<<DTO>>
Contract
+CreateUnitOfWork() +GetEntities<T>():IQueriable<T>
iQuarcDataAccess
25. Isolate from external libraries
<<static class>>
Log
+LogError()
+LogWarining()
Exception Wrappers Decorators
<<Interface>>
API Interfaces
25
26. Application Infrastructure – Shaping to Context
.NET Framework
WF
WCF
WEB API
ASP.NET
Entity
Framework
. . . Unity
NServiceBus Log4Net
. . .
Application Infrastructure
Application Functionalities
27. When to do it?
cumulativefunctionality
time
completion
construction
ready
design payoff
28. When to do it?cumulativefunctionality
time
completion
construction
ready
design payoff
time
Arc
Arc
Infra
FunctionalityInfra
FunctionalityInfra
Functionality
Functionality
Functionality
Functionality
RepositoryImpl
+ GetEntities<T>() : IQueriable()
IRepository IUnitOfWork
+ SaveChanges()
IModule
<<Attribute>>
ServiceAttribute
iQuarc
Functionality