Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
The
Lucid
Architecture
Building Scalable Applications
Abed Halawi - Tech Lead at Vinelab
@mulkave
What is an Architecture?
What is an Architecture?
Pattern of connected Structures
Structure & Architecture
Structure
Architecture
An expression
of a
What is an architecture?
viewpoint
Why Do We Have Them?
Why Do We Have Them?
Communicate Structures
Controller ✅
Model ✅
View ✅
Service ⁉
Domain ⁉
Why Do We Have Them?
Eradecate Homelessness
of Code
0
25
50
75
100
0
25
50
75
100
v1.0 v1.2
😈👺
Why Do We Have Them?
Eradecate Homelessness
of Code
Why Do We Have Them?
Illustrate Structures
Request
Http
Kernel
Closure
Controller
Route
Process
&
Respond
DDD?
Technical
D...
Legacy Code
• No More Legacy Code
• Defines Terminology
• Comprehensive, No Limitations
• Complements Laravel’s Design
• Simple, Yet So...
Lucid
Lucid
Lucid • Components
Feature
Job
Service
Lucid • Feature
• As described in business, as a class name
• Runs Jobs - Steps in the process of accomplishment
CreateArt...
Lucid • Feature
• Controllers serve Features
Lucid • Job
A class that does one thing; responsible for the
business logic
• CreateArticleFeature
• Validate Article Inpu...
Lucid • Job
A class that does one thing; responsible for the
business logic
• CreateArticleFeature
• ValidateArticleInputJ...
Lucid • Job
A class that does one thing; responsible for the
business logic
Controller Feature
serve
Validate Input
Genera...
1
3
2
1 2 3
Lucid • Service
Implements Features and serves them through
controllers
Website
Api
Backend
Lucid • Service
• Website
• ListArticlesFeature
• GetPublishedArticlesJob
• RespondWithViewJob
• Api
• ListArticlesFeature...
Lucid • Service
• Website
• ListArticlesFeature
• GetPublishedArticlesJob
• RespondWithViewJob
• Api
• ListArticlesFeature...
Lucid • Service
• Website
• ListArticlesFeature
• GetPublishedArticlesJob
• RespondWithViewJob
• Api
• ListArticlesFeature...
Lucid • Service
Http
Kernel
Which
Service?
Controller Feature
Website
Route
Controller Feature
Api
Route
Controller Featur...
Lucid • Domains
Responsible for the entities; exposing their
functionalities through Jobs
Lucid • Domains
• Article
• GetPublishedArticlesJob
• SaveArticleJob
• ValidateArticleInputJob
• Cdn
• UploadFilesToCdnJob...
Lucid • Layers
Service Domain Data
F
A
T
U
R
E
E
J
O
B
M
D
E
L
O
Lucid • Principles ✍
1. Controllers serve Features
2. Avoid Cross-Domain Communication
3. Avoid Cross-Job Communication
Getting Started
> composer create-project lucid-arch/laravel my-project
1. Init a project
> lucid make:service Api
2. Scaf...
Lucid • Console
The Lucid Architecture for Building Scalable Applications - Given at LaraconEU 2016 by Abed Halawi
The Lucid Architecture for Building Scalable Applications - Given at LaraconEU 2016 by Abed Halawi
The Lucid Architecture for Building Scalable Applications - Given at LaraconEU 2016 by Abed Halawi
The Lucid Architecture for Building Scalable Applications - Given at LaraconEU 2016 by Abed Halawi
The Lucid Architecture for Building Scalable Applications - Given at LaraconEU 2016 by Abed Halawi
The Lucid Architecture for Building Scalable Applications - Given at LaraconEU 2016 by Abed Halawi
The Lucid Architecture for Building Scalable Applications - Given at LaraconEU 2016 by Abed Halawi
The Lucid Architecture for Building Scalable Applications - Given at LaraconEU 2016 by Abed Halawi
The Lucid Architecture for Building Scalable Applications - Given at LaraconEU 2016 by Abed Halawi
Upcoming SlideShare
Loading in …5
×

The Lucid Architecture for Building Scalable Applications - Given at LaraconEU 2016 by Abed Halawi

440 views

Published on

Developing large-scale applications has always been easy to think about but when it comes to implementation, complexities start laying themselves on the table especially when working in a collaborative team where decisions are peer-discussed and made over coffee or beer on a napkin. Moreover, with the rise of the microservice architecture trend, where dissecting the monolith you’ve always been working on becomes the next big thing in the project, the need for guidelines and standards becomes crucial for the task to reach success. In this opinionated architecture, you’ll learn about patterns that, when followed, will serve answering questions like "Where should this good piece of art code reside (folder, file, class, etc.)?”, "What design patterns should we apply to implement this feature?”, “What features are implemented in this project?”, “What are the different steps to accomplish a specific feature?”, and most importantly will make your monolith-to-service transition easier.

Published in: Software
  • Be the first to comment

  • Be the first to like this

The Lucid Architecture for Building Scalable Applications - Given at LaraconEU 2016 by Abed Halawi

  1. 1. The Lucid Architecture Building Scalable Applications Abed Halawi - Tech Lead at Vinelab @mulkave
  2. 2. What is an Architecture?
  3. 3. What is an Architecture? Pattern of connected Structures
  4. 4. Structure & Architecture
  5. 5. Structure
  6. 6. Architecture
  7. 7. An expression of a What is an architecture? viewpoint
  8. 8. Why Do We Have Them?
  9. 9. Why Do We Have Them? Communicate Structures Controller ✅ Model ✅ View ✅ Service ⁉ Domain ⁉
  10. 10. Why Do We Have Them? Eradecate Homelessness of Code 0 25 50 75 100 0 25 50 75 100 v1.0 v1.2 😈👺
  11. 11. Why Do We Have Them? Eradecate Homelessness of Code
  12. 12. Why Do We Have Them? Illustrate Structures Request Http Kernel Closure Controller Route Process & Respond DDD? Technical Debt 🤑 SOA?
  13. 13. Legacy Code
  14. 14. • No More Legacy Code • Defines Terminology • Comprehensive, No Limitations • Complements Laravel’s Design • Simple, Yet Sophisticated • Performs at Scale What? How? 🤔
  15. 15. Lucid
  16. 16. Lucid
  17. 17. Lucid • Components Feature Job Service
  18. 18. Lucid • Feature • As described in business, as a class name • Runs Jobs - Steps in the process of accomplishment CreateArticleFeature LoginUserFeature Controller Process & Respond Feature serve
  19. 19. Lucid • Feature • Controllers serve Features
  20. 20. Lucid • Job A class that does one thing; responsible for the business logic • CreateArticleFeature • Validate Article Input • Generate Slug • Upload Files To Cdn • Save Article • Respond With Json
  21. 21. Lucid • Job A class that does one thing; responsible for the business logic • CreateArticleFeature • ValidateArticleInputJob • GenerateSlugJob • UploadFilesToCdnJob • SaveArticleJob • RespondWithJsonJob
  22. 22. Lucid • Job A class that does one thing; responsible for the business logic Controller Feature serve Validate Input Generate Slug Upload Files To CDN Save Article Respond With JSON ]Process & ] Respond
  23. 23. 1 3 2 1 2 3
  24. 24. Lucid • Service Implements Features and serves them through controllers Website Api Backend
  25. 25. Lucid • Service • Website • ListArticlesFeature • GetPublishedArticlesJob • RespondWithViewJob • Api • ListArticlesFeature • GetPublishedArticlesJob • RespondWithJsonJob • Backend • CreateArticleFeature • ValidateArticleInputJob • SaveArticleJob • RespondWithViewJob
  26. 26. Lucid • Service • Website • ListArticlesFeature • GetPublishedArticlesJob • RespondWithViewJob • Api • ListArticlesFeature • GetPublishedArticlesJob • RespondWithJsonJob • Backend • CreateArticleFeature • ValidateArticleInputJob • SaveArticleJob • RespondWithViewJob
  27. 27. Lucid • Service • Website • ListArticlesFeature • GetPublishedArticlesJob • RespondWithViewJob • Api • ListArticlesFeature • GetPublishedArticlesJob • RespondWithJsonJob • Backend • CreateArticleFeature • ValidateArticleInputJob • SaveArticleJob • RespondWithViewJob
  28. 28. Lucid • Service Http Kernel Which Service? Controller Feature Website Route Controller Feature Api Route Controller Feature Backend Route example.com api.example.com OR example.com/api admin…com OR example.com/api Domains
  29. 29. Lucid • Domains Responsible for the entities; exposing their functionalities through Jobs
  30. 30. Lucid • Domains • Article • GetPublishedArticlesJob • SaveArticleJob • ValidateArticleInputJob • Cdn • UploadFilesToCdnJob • Http • RespondWithJsonJob
  31. 31. Lucid • Layers Service Domain Data F A T U R E E J O B M D E L O
  32. 32. Lucid • Principles ✍ 1. Controllers serve Features 2. Avoid Cross-Domain Communication 3. Avoid Cross-Job Communication
  33. 33. Getting Started > composer create-project lucid-arch/laravel my-project 1. Init a project > lucid make:service Api 2. Scaffold a Service > lucid make:feature Api LoginUser 3. Generate a Feature > lucid make:job User CheckCredentials 4. Generate a Job
  34. 34. Lucid • Console

×