4. A brief of technical history
27/06/2013 Clean Architecture / Meetup Alt.Net # 4
SPORTSBOOK (PRE LIVE / LIVE)
TURF
CASINO / LIVE CASINO / GAMES
COMMON
BETCLIC.FR
(VB.Net WebFoms)
BETCLIC.COM
(VB.Net WebFoms)
BETCLIC.IT
(C# WebForms)
COMMON COMMON
SPORTSBOOK (PRE LIVE / LIVE) SPORTSBOOK (PRE LIVE / LIVE)
POKER
CASINO / LIVE CASINO / GAMES
POKERPOKER
BETCLIC.IT
(C# MVC)
POKER MVC
5. (Almost) Actual technical solution
27/06/2013 Clean Architecture / Meetup Alt.Net # 5
BETCLIC.FR BETCLIC.COM BETCLIC.IT
SPORTSBOOK (PRE LIVE / LIVE) - (ASP.Net MVC4)
TURF - (ASP.Net MVC4)
POKER - (ASP.Net MVC4)
CASINO / LIVE CASINO / GAMES - (ASP.Net MVC4)
GLOBAL (REGISTER / PAYMENT / MY ACCOUNT) – (Portable areas)
6. Actual technical solution – Portable Areas
27/06/2013 Clean Architecture / Meetup Alt.Net # 6
A Portable Area is a dll that contains items that would normally be part of your
solution.
Portable Areas contain Views, Controllers, Models, even JS Scripts, CSS files
and images.
The items in your Portable Area work together to create cohesive functionality.
Portable Areas are meant for mature functionality to be re-used in multiple
projects or solutions as-is.
Apache License 2.0
7. Actual technical solution - Views
27/06/2013 Clean Architecture / Meetup Alt.Net # 7
A custom ViewEngine
The deeper you go, the more specific you get
11. Actual technical solution - Views
27/06/2013 Clean Architecture / Meetup Alt.Net # 11
Personal Details .Com Partial View Personal Details .Fr Partial View
12. Clean Architecture
6/27/2013 Clean Architecture / Meetup Alt.Net # 12
What Uncle Bob says:
“A good architecture allows you to defer critical decisions like the UI,
frameworks, database, etc.”
“A good architecture allows you to defer critical decisions, it doesn’t force you to
defer them. However, if you can defer them, it means you have lots of flexibility.
For example, you could create an interim simple UI for the first few sprints, and
then replace it with a more capable UI later.”
“The application code is completely decoupled from the UI. You can test the
application code without the UI present. You don’t need to fire up the web server,
or the container, or Rails, or any of the other frameworks in order to run your
tests.”
13. 6/27/2013 Clean Architecture / Meetup Alt.Net
Inftrastructure /
DAL
Core / BLL
UI
DB
Utilities/Common/Shared
nHibernate /
Entity Fmwk
ASP.NET
Log4Net
AutoMapper
StructureMap
Traditional n-tiers
Architecture
15. Onion Architecture
27/06/2013 Clean Architecture / Meetup Alt.Net # 15
• Everything unique to the business: Domain model, validation rules,
business workflows
• Defines all technical implementation (non-business) needs as interfaces
• CANNOT reference any external libraries
• NO technology specific code
Core
• Provide implementations for Core interfaces
• Call web services, access a database
• CAN reference external libraries to provide implementations
• ONLY technology specific code (non-business) belongs in infrastructure
Infrastructure
• Very thin layer, has no logic of its own
• Wires up Core interfaces to Infrastructure implementations.
• Runs startup/configuration logic
Dependency
Resolution
16. Onion Architecture - Benefits
27/06/2013 Clean Architecture / Meetup Alt.Net # 16
– Draw application using concentric circles
– Direction of dependency is toward the center
– Externalize all technology related code
– Limit re-write necessity over time as business logic is entirely self-
contained
– Developers know where components go
– Infrastructure is free to use any provider to do its work
– Business logic has no dependency tentacles
– True loose coupling between layers/components
– UI and Data Access “layers” become much smaller, deal strictly with
technology-related code
17. Teams organization
27/06/2013 Clean Architecture / Meetup Alt.Net # 17
Global Team
Global packages
Sport Front Team
Casino Front Team
Poker Front Team
Turf Front Team
18. Teams organization
27/06/2013 Clean Architecture / Meetup Alt.Net # 18
Sport Team
RM Team
Sport.Betclic.fr
Sport.Betclic.com
Sport.Expekt.com
19. Teams organization
# 19
Head of region decides how he wants his area to evolve
Each IT domain addresses all brands / all sites
One Program manager for each domain
Product Owners manage agile product backlog in sprint
Each development team has a Project Leader + a Lead Developer
BETCLIC.FR BETCLIC.COM BETCLIC.IT
SPORTSBOOK (PRE LIVE / LIVE)
TURF
POKER
CASINO / LIVE CASINO / GAMES
GLOBAL (REGISTER / PAYMENT / MY ACCOUNT)Global Dev Team
Sport Dev Team
Business
Poker Dev Team
Casino Dev Team
Turf Dev Team
Business Business
21. References / Links
27/06/2013 Clean Architecture / Meetup Alt.Net # 21
– Uncle Bob – Clean Architecture
– Jeffrey Palermo
– Matt Hidinger
– Me and the Onion on StackOverflow
– Betclic Tech Blog