Over the last year there has been a lot of buzz about Clean Architecture in the Android community, but what is Clean Architecture? How does it work? And should I be using it? Recently at Badoo we decided to rewrite our messenger component.
Over the years this core piece of functionality in our app has become large and unwieldy. We wanted to take a fresh approach to try and prevent this from happening again. We choose to use Clean Architecture to achieve our goal. This talk intends to share our journey from theory to implementation in an application with over 100 million downloads. By the end, you should not only understand what Clean Architecture is, but how to implement it, and whether you should.
There's another talk about Clean Architecture, SOLID, and our approach at InfoJobs. If you need the slides, don't hesitate to fork https://github.com/schibsted-android-training/workshop-5
Introducing Android Architecture
If you would like to view the related sample codes, you can refer to link below:
https://github.com/ZahraHeydari/ArtGallery
We like the architecture of our applications to revolve around the business logic, not around technical details (and especially not around the database).
In my team at Sky Network Services we use the Clean Architecture and it has given us a great deal of benefits: the business logic is explicit, we are free to change our technical decisions, the app is easy to test, working on it is faster and scalable, it’s hard to do the wrong thing, and many more.
But it comes at a cost, of course. In this talk I’ll tell you the story of our experience with Clean Architecture and give you some tips to get the most out of it.
Example Project
https://github.com/mattia-battiston/clean-architecture-example
Downloads
Online: https://goo.gl/DTxftJ
PDF: https://goo.gl/ZAtdBN
Powerpoint: https://goo.gl/D54wdZ (but you need to install these fonts to see it properly: https://goo.gl/iH8SO5)
There's another talk about Clean Architecture, SOLID, and our approach at InfoJobs. If you need the slides, don't hesitate to fork https://github.com/schibsted-android-training/workshop-5
Introducing Android Architecture
If you would like to view the related sample codes, you can refer to link below:
https://github.com/ZahraHeydari/ArtGallery
We like the architecture of our applications to revolve around the business logic, not around technical details (and especially not around the database).
In my team at Sky Network Services we use the Clean Architecture and it has given us a great deal of benefits: the business logic is explicit, we are free to change our technical decisions, the app is easy to test, working on it is faster and scalable, it’s hard to do the wrong thing, and many more.
But it comes at a cost, of course. In this talk I’ll tell you the story of our experience with Clean Architecture and give you some tips to get the most out of it.
Example Project
https://github.com/mattia-battiston/clean-architecture-example
Downloads
Online: https://goo.gl/DTxftJ
PDF: https://goo.gl/ZAtdBN
Powerpoint: https://goo.gl/D54wdZ (but you need to install these fonts to see it properly: https://goo.gl/iH8SO5)
SOLID Principles and The Clean ArchitectureMohamed Galal
This presentation is held at @blablaconnect Cairo office, Monday 31 December 2018.
In this presentation we will discuss the following topics:
- SOLID principles.
- Design Pattern vs. Clean Architecture.
- Successful software architecture characteristics.
- The Clean Architecture.
- Real life example.
2012 the clean architecture by Uncle bob GEORGE LEON
Very interesting 2012 the clean architecture by Uncle Bob
Also go buy the book Clean Architecture: A Craftsman's Guide to Software Structure and Design (Robert C. Martin Series)
A Separation of Concerns: Clean Architecture on AndroidOutware Mobile
Presented at YOW! Connected 2015 by Kamal Kamal Mohamed & Ryan Hodgman
As an Android developer, I want to deliver features without making compromises on code quality.
Scenario 1 - Given I am dealing with 1000+ line activities, When I have to develop a complicated feature, Then I waste time orienting myself and fixing bugs.
Scenario 2 - Given I have integrated a backend API directly into my app logic, When that API changes, Then I have to refactor large segments of unrelated logic in order to utilise the new API.
Scenario 3 - Given I have cleanly architected my application, When business/presentation/backend logic changes, Then I can easily update the relevant code without breaking unrelated features!
In this talk, two Android developers will present their take on what a cleanly architected app looks like and why it makes our lives easier. A well-defined separation of concerns has benefits not just for our sanity as developers, but also for the project workflow as it allows multiple developers to collaborate on a single feature with ease. We will be exploring how the domain-driven approach can improve code clarity, allow you to easily write tests, and provide a scalable infrastructure for you to quickly iterate on. Join us on our path of discovery as we discuss the advantages, drawbacks and implementation specifics in the context of a small sample project.
Commands, events, queries - three types of messages that travel through your application. Some originate from the web, some from the command-line. Your application sends some of them to a database, or a message queue. What is the ideal infrastructure for an application to support this on-going stream of messages? What kind of architectural design fits best?
This talk provides answers to these questions: we take the *hexagonal* approach to software architecture. We look at messages, how they cross boundaries and how you can make steady communication lines between your application and other systems, like web browsers, terminals, databases and message queues. You will learn how to separate the technical aspects of these connections from the core behavior of your application by implementing design patterns like the *command bus*, and design principles like *dependency inversion*.
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Steve Pember
In this presentation we will present the general philosophy of Clean Architecture, Hexagonal Architecture, and Ports & Adapters: discussing why these approaches are useful and general guidelines for introducing them to your code. Chiefly, we will show how to implement these patterns within your Spring (Boot) Applications. Through a publicly available reference app, we will demonstrate what these concepts can look like within Spring and walkthrough a handful of scenarios: isolating core business logic, ease of testing, and adding a new feature or two.
Clean Architecture Essentials - Stockholm Software CraftsmanshipIvan Paulovich
About the talk:
Software Architecture is not about picking frameworks then gluing the pieces together! Let's dig into a software implementation designed to support the use cases, we will learn how to make the use cases a standalone component and see how a good architecture allows major decisions to be deferred. We will discuss component coupling and cohesion during the development timeline. Is your application architecture a Web Application? Are your tests taking too long to run? You will learn how to make the delivery mechanism an irrelevant and testable detail.
About the speaker:
Ivan Paulovich is an Agile .NET developer that enjoy solutions based on use cases and decoupled from technology details. Active on GitHub he supports OSS about Domain-Driven Design, TDD, Event Sourcing, CQRS, SOLID and Microservices. Microsoft MVP Reconnect. Checkout @ivanpaulovich on GitHub.
Slides of the talk I gave at ConFoo Montréal 2019 about "Hexagonal Architecture".
Hexagonal Architecture, Clean Architecture, Domain-Driven Design… You may have heard about them. Let's start from scratch in this session and go beyond the buzzwords. We'll go together though these ideas to understand how you can improve the maintainability of your projects', either greenfield or legacy.
Clean Pragmatic Architecture - Avoiding a MonolithVictor Rentea
Talk built based on several of my trainings: http://www.victorrentea.ro/#training
Covers: Clean/Onion/Hexagonal Architecture, Domain Entities, Value Objects, Repository, Extract When it Grows Principle, Dependency Inversion Principle, Clean Code and Design Patterns.
These are the backing slides of the talks given at JPoint 2017 and Devoxx PL 2017: https://www.youtube.com/embed/4-4ahz7zDiQ
Understanding MicroSERVICE Architecture with Java & Spring BootKashif Ali Siddiqui
This is a deep journey into the realm of "microservice architecture", and in that I will try to cover each inch of it, but with a fixed tech stack of Java with Spring Cloud. Hence in the end, you will be get know each and every aspect of this distributed design, and will develop an understanding of each and every concern regarding distributed system construct.
Android Clean Architecture for DummiesKengo Suzuki
Brief tutorial of implementing very primitive app(single list view) using Android Clean Architecture. It won't describe what and why, but rather, how to use it.
SOLID Principles and The Clean ArchitectureMohamed Galal
This presentation is held at @blablaconnect Cairo office, Monday 31 December 2018.
In this presentation we will discuss the following topics:
- SOLID principles.
- Design Pattern vs. Clean Architecture.
- Successful software architecture characteristics.
- The Clean Architecture.
- Real life example.
2012 the clean architecture by Uncle bob GEORGE LEON
Very interesting 2012 the clean architecture by Uncle Bob
Also go buy the book Clean Architecture: A Craftsman's Guide to Software Structure and Design (Robert C. Martin Series)
A Separation of Concerns: Clean Architecture on AndroidOutware Mobile
Presented at YOW! Connected 2015 by Kamal Kamal Mohamed & Ryan Hodgman
As an Android developer, I want to deliver features without making compromises on code quality.
Scenario 1 - Given I am dealing with 1000+ line activities, When I have to develop a complicated feature, Then I waste time orienting myself and fixing bugs.
Scenario 2 - Given I have integrated a backend API directly into my app logic, When that API changes, Then I have to refactor large segments of unrelated logic in order to utilise the new API.
Scenario 3 - Given I have cleanly architected my application, When business/presentation/backend logic changes, Then I can easily update the relevant code without breaking unrelated features!
In this talk, two Android developers will present their take on what a cleanly architected app looks like and why it makes our lives easier. A well-defined separation of concerns has benefits not just for our sanity as developers, but also for the project workflow as it allows multiple developers to collaborate on a single feature with ease. We will be exploring how the domain-driven approach can improve code clarity, allow you to easily write tests, and provide a scalable infrastructure for you to quickly iterate on. Join us on our path of discovery as we discuss the advantages, drawbacks and implementation specifics in the context of a small sample project.
Commands, events, queries - three types of messages that travel through your application. Some originate from the web, some from the command-line. Your application sends some of them to a database, or a message queue. What is the ideal infrastructure for an application to support this on-going stream of messages? What kind of architectural design fits best?
This talk provides answers to these questions: we take the *hexagonal* approach to software architecture. We look at messages, how they cross boundaries and how you can make steady communication lines between your application and other systems, like web browsers, terminals, databases and message queues. You will learn how to separate the technical aspects of these connections from the core behavior of your application by implementing design patterns like the *command bus*, and design principles like *dependency inversion*.
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Steve Pember
In this presentation we will present the general philosophy of Clean Architecture, Hexagonal Architecture, and Ports & Adapters: discussing why these approaches are useful and general guidelines for introducing them to your code. Chiefly, we will show how to implement these patterns within your Spring (Boot) Applications. Through a publicly available reference app, we will demonstrate what these concepts can look like within Spring and walkthrough a handful of scenarios: isolating core business logic, ease of testing, and adding a new feature or two.
Clean Architecture Essentials - Stockholm Software CraftsmanshipIvan Paulovich
About the talk:
Software Architecture is not about picking frameworks then gluing the pieces together! Let's dig into a software implementation designed to support the use cases, we will learn how to make the use cases a standalone component and see how a good architecture allows major decisions to be deferred. We will discuss component coupling and cohesion during the development timeline. Is your application architecture a Web Application? Are your tests taking too long to run? You will learn how to make the delivery mechanism an irrelevant and testable detail.
About the speaker:
Ivan Paulovich is an Agile .NET developer that enjoy solutions based on use cases and decoupled from technology details. Active on GitHub he supports OSS about Domain-Driven Design, TDD, Event Sourcing, CQRS, SOLID and Microservices. Microsoft MVP Reconnect. Checkout @ivanpaulovich on GitHub.
Slides of the talk I gave at ConFoo Montréal 2019 about "Hexagonal Architecture".
Hexagonal Architecture, Clean Architecture, Domain-Driven Design… You may have heard about them. Let's start from scratch in this session and go beyond the buzzwords. We'll go together though these ideas to understand how you can improve the maintainability of your projects', either greenfield or legacy.
Clean Pragmatic Architecture - Avoiding a MonolithVictor Rentea
Talk built based on several of my trainings: http://www.victorrentea.ro/#training
Covers: Clean/Onion/Hexagonal Architecture, Domain Entities, Value Objects, Repository, Extract When it Grows Principle, Dependency Inversion Principle, Clean Code and Design Patterns.
These are the backing slides of the talks given at JPoint 2017 and Devoxx PL 2017: https://www.youtube.com/embed/4-4ahz7zDiQ
Understanding MicroSERVICE Architecture with Java & Spring BootKashif Ali Siddiqui
This is a deep journey into the realm of "microservice architecture", and in that I will try to cover each inch of it, but with a fixed tech stack of Java with Spring Cloud. Hence in the end, you will be get know each and every aspect of this distributed design, and will develop an understanding of each and every concern regarding distributed system construct.
Android Clean Architecture for DummiesKengo Suzuki
Brief tutorial of implementing very primitive app(single list view) using Android Clean Architecture. It won't describe what and why, but rather, how to use it.
Skroutz Android MVP and Adapter Delegates presentationgmetal
A desciption of how we, at skroutz.gr, moved our native android application from an MVC-based approach to an MVP-based approach. After having MVP, we then moved our codebase to use RecyclerViews, with the AdapterDelegates library, that promotes code reuse and composition across RecyclerView Adapters
Explanation of Android MVP Architecture Pattern. This slide deck is used to explain the principles behind the pattern. It has a companion github repository which helps demonstrate the pattern.
https://github.com/jpotts18/android-mvp
The 3h workshop version of the 3d Advanced Architectures training (http://canonicalexamples.com/courses_ios/#iOSArch). I have delivered this one or the Android counterpart in more than 20 cities in Europe and America. This is version that I shared in Cluj Napoca.
Our poster at @britishHCI2015 on Designing a participatory sensing game with children with our game & device called UKKO which collects air quality data with an inspired Tamagotchi game.
http://dl.acm.org/citation.cfm?doid=2783446.2783602
Developers choose HTTP for its ubiquity. HTTP's semantics are cherry-picked or embraced in the myriad of apis we develop and consume. Efficiency discussions are commonplace: Does this design imply N+1 requests? Should we denormalize the model? How do consumers discover changes in state? How many connections are needed to effectively use this api?
Meanwhile, HTTP 1.1 is a choice, as opposed to constant. SPDY and HTTP/2 implementations surface, simultaneously retaining semantics and dramatically changing performance implications. We can choose treat these new protocols as more efficient versions HTTP 1.1 or buy into new patterns such as server-side push.
This session walks you through these topics via an open source project from Square called okhttp. You'll understand how okhttp addresses portability so that you can develop against something as familiar as java's HTTPUrlConnection. We'll review how to use new protocol features and constraints to keep in mind along the way. You'll learn how to sandbox ideas with okhttp's mock server, so that you can begin experimenting with SPDY and HTTP/2 today!
Schmutz im Code behindert mittel- und langfristig effiziente Software-Entwicklung. Seine Ursachen sind vielfältig. Clean Code zeigt, wie wir effizienter arbeiten und gleichzeitig höhere Komplexität handhaben können. Ein spezieller Clean-Code-Prozess hilft, Clean-Code-Maßnahmen im Projektalltag lebendig werden zu lassen. Muss wartbarer Code höher bewertet werden als funktionierender Code?
Weitere Vorträge, die wir auch gern in Ihrem Unternehmen halten, finden Sie unter: https://www.iks-gmbh.com/impulsvortraege
The base architecture of iOS is MVC (Model View Controller) which leads into known as Massive View Controller, where the View Controllers end up doing so many logic. It is easy to mix UI code and business logic together which is the wrong way to test the logic.
VIPER is one of a modern architecture made for this issue. It is based by Uncle Bob's Clean Architecture. It use the Separation of Concern principle which make the code cleaner and easy to maintenance.
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1VoUxQr.
Rachel Reese talks about Jet.com's chaos testing methods and code in depth, but also lays out a path to implementation that everyone can use. Filmed at qconlondon.com.
Rachel Reese is a long-time software engineer and math geek. She currently helps run the Nashville F# User group, NashFSharp, and previously ran the Burlington, VT functional programming user group, VTFun. She's also an ASPInsider, an F# MVP, a community enthusiast, one of the founding lambdaladies, and a Rachii.
Patterns & Practices for Cloud-based MicroservicesC4Media
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/2cSK2H0.
Rachel Reese talks about the lessons she has learned at Jet.com on their way to developing the platform and how they’ve schooled themselves on what works and what doesn't for F# and microservices. Filmed at qconnewyork.com.
Rachel Reese is a long-time software engineer and math geek. She currently helps run the Nashville F# User group, NashFSharp, and previously ran the Burlington, VT functional programming user group, VTFun. She's also an ASPInsider, an F# MVP, a community enthusiast, one of the founding lambdaladies, and a Rachii.
Presentation from DDD Sydney, May 28th, 2016
Buzz word! More buzz words! And another buzz word!! Now that that's out of the way, if you're thinking of heading down the microservices path, then how do you do it? How do you build the services? What do you need to think about if you're starting from scratch? What if you're converting a legacy app? How do we deal with versioning? Do we have to use a NoSQL solution, just because Netflix does? Do we need to use docker/containers? What about the code? Show me the code! Well, that's what this session is all about. Designing and building microservices in .NET and then handling a bunch of other concerns that a microservices approach will force you to think about. Sounds interesting, doesn't it? You betcha.
Through this presentation you will gain a good understanding of how the clean architecture pattern is implemented at Taxibeat. What issues the Android Taxibeat team has faced so far and what solutions we came up with. Of course, the benefits of clean architecture will also be discussed along with the way we managed to build two fast paced iterative apps that share functionality.
Throughout the years, the Concentric Architectures (Onion, Hexagonal, Clean-..) have grown into the undisputed leader among backend systems architectures. With the rise of Domain-Driven Design, keeping your Domain ring 'agnostic' to the outside world has become the norm today. But history proved that any 'norm' in software architectures will cause overengineering if applied without criticism.
After a brief recap of these architectures, their pitfalls, and weaknesses, we'll see two alternatives that segregate code not in 'layers' or 'rings' but in vertical slices: Feature Slicing and Modular Monolith.
[Feature Slicing](vertical Slice Architecture) (aka *UseCase) has its own pitfalls and weaknesses, that we'll briefly review. But this will just warm us up for the next style.
Modular Monolith (aka Modulith) is an architecture style that helped many companies break their legacy codebases, and smoothly move to microservices. Most of the techniques discussed here can also come handy when one single microservice grew big and needs to be broken down.
Even more, greenfield projects today opt for this architecture instead of microservices, to avoid paying the high cost of distributability. Imagine cohesive but decoupled modules living in the same code base & deployment, but on which different teams work in harmony, delivering more value much faster than an equivalent microservice ecosystem.🦄
On the agenda:
- patterns to break data structures
- how to protect Domains inside modules
- communication patterns between modules
- breaking cyclic dependencies
Low latency microservices in java QCon New York 2016Peter Lawrey
In this talk we explore how Microservices and Trading System overlap and what they can learn from each other. In particular, how can we make microservices easy to test and performant. How can Trading System have shorter time to market and easier to maintain.
Patterns and practices for real-world event-driven microservices by Rachel Re...Codemotion Dubai
At Jet.com, we've based our architecture around cloud-based event-driven microservices, and over the last several months, have schooled ourselves on what works and what doesn't. This session will walk you through the lessons we have learned on our way to developing our platform.
Patterns and practices for real-world event-driven microservicesRachel Reese
Jet.com is an e-commerce startup competing with Amazon. We're heavy users of F#, and have based our architecture around Azure-based event-driven functional microservices. Over the last several months, we've schooled ourselves on what works and what doesn't for F# and microservices. This session will walk you through the lessons we have learned on our way to developing our platform.
How to write clean & testable code without losing your mindAndreas Czakaj
If you create software that is to be developed continuously over several years you'll need a sustainable approach to code quality.
In our early days of AEM development, however, we used to struggle with code that is rigid, hard to test and full of LOG.debug calls.
In this talk I will share some development best practices we have found that really work in actual AEM based software, e.g. to achieve 100% code coverage and provide high confidence in the code base.
Spoiler alert: no new libraries, frameworks or tools are required - once you know the ideas, plain old TDD and the S.O.L.I.D. principles of Clean Code will do the trick.
by Andreas Czakaj, mensemedia Gesellschaft für Neue Medien mbH
Presented at the adaptTo() 2017 conference in Berlin (https://adapt.to/2017/en/schedule/how-to-write-clean---testable-code-without-losing-your-mind.html).
Presentation video can be found on YouTube (https://www.youtube.com/watch?v=JbJw5oN_zL4)
I've seen projects with shiny, new code render into unmaintainable big balls of mud within 2-3 years. Multiple times. But regardless of whether it's the code base as a whole that's rotten, or whether it's just the UI and User Experience that needs a major overhaul: the question on rewrite vs refactoring will come up sooner or later. Based on years of experience, and a plethora of bad decisions cumulating into epic failures, I'll share my experience on how to have a code base that stays maintainable - even after years. After this talk, you'll have more insight into whether you should refactor or rewrite, and how to do it right from now on.
How and why we evolved a legacy Java web application to Scala... and we are s...Katia Aresti
Applications get old, and technology moves fast. Overtime, adding or modifying functionalities might become as expensive as re-coding everything all from scratch. But rewriting a complete website and its functionalities it’s hard if we want to minimize the risks of breaking existing functionalities and specially when this application fits in a ecosystem and interacts with other pieces of software and teams.
In this session, you will learn how we moved from a legacy java monolithic website using scala PlayFramework, AngularJS, Elasticsearch and MongoDB, how we built a multi service and REST oriented architecture, which were the technical and human problems we encountered and how we managed to solved them.
2017 Microservices Practitioner Virtual Summit: Microservices at Squarespace ...Ambassador Labs
This talk covers the past, present, and future of Microservices at Squarespace. We begin with our journey to microservices, and describe the platform that made this possible. We introduce our idea of the “Pillars of Microservices”, everything a developer needs to have a successful production service. For each pillar we describe why we think it is important and discuss the implementation and how we utilize it in our environment. Next, we look to the future evolution of our microservices environment including how we are using containerization and Kubernetes to overcome some of the problems we’ve faced with more static infrastructure.
iOS Parallel Automation: run faster than fast — Viktar Karanevich — SeleniumC...Badoo
iOS Automation rapidly changed due to the evolution of Apple automation frameworks and Calabash community support. One year ago, we parallelised our iOS testing with multiple desktops – a large improvement in performance. Here is an account of the subsequent changes, including the removal of multiple desktops and the adoption of Apple’s new XCTest framework.
The automation community (Appium, Calabash etc.) faced a new challenge: how could we create iOS Automation Infrastructure with the new XCTest Framework?
I adopted Facebook solution (FBSimCtl and WebAgentDriver) into the multi-simulators approach. In this talk, I will discuss the full evolution path to Facebash Approach based on multi-simulators, Calabash server and Facebook Web Driver Agent.
Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Tes...Badoo
What does it usually look like when people do Mobile Web Test Automation? They write a couple of tests, run them on different desktop browsers, and then only after that, try to run on emulators/simulators. The final step is adapting and fixing the tests for browsers on real devices.
Luckily, we developed our tests for Mobile Web on real devices. But some time ago we decided to run on Desktop as well.
Why? What were the benefits for us? How do we have both Appium and Selenium tests in one repository? And what challenges did we face? I'll discuss this, as well as many other things, in my talk.
iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (...Badoo
iOS Automation rapidly changed due to the evolution of Apple automation frameworks and Calabash community support. One year ago, we parallelised our iOS testing with multiple desktops - a large improvement in performance. Here is an account of the subsequent changes, including the removal of multiple desktops and the adoption of Apple's new XCTest framework.
The automation community (Appium, Calabash etc.) were faced with a new challenge: how could we create iOS Automation Infrastructure with the new XCTest Framework?
I adopted Facebook solution (FBSimCtl and WebAgentDriver) into the multi-simulators approach. In this talk, I will discuss the full evolution path to Hybrid Approach based on multi-simulators and XCTest framework, using Facebook open-source tools.
Half way to clean architecture - Dmytro Voronkevych - Droidcon BerlinBadoo
There are many rumors surrounding Uncle Bob’s clean architecture. Many believe it’s a silver bullet that will solve every problem. This sounds great for anyone who wants to write a new application, but how do you safely transition a code base with ~100k lines of code and 5 years of history?
Our story is about an Android application with over 100 million installs, used by millions of people every day and is very profitable. The journey started with legacy code, then grew and transitioned into clean architecture. This was implemented all while working in a high-pressure environment with tough deadlines, constant changes and a lot at stake.
It all started as a j2me application, which rapidly grew, becoming legacy. It then required changes overall for improvement and maintenance. On top of the complications we faced, we then had to split the application, creating several new ones. Through this process we managed to improve our code by experimenting a lot, having many discussions, internal tech talks and also restructuring our team. Overall we learned a great deal!
I hope sharing these experiences will inspire other teams to start experimenting with architecture in a safe way.
How Badoo Saved $1M Switching to PHP7 - Nikolay Krapivnyy - PHPDay Verona 2016Badoo
PHP7 is the new generation of the php engine which is dramatically faster than 5.6 and significantly reduces memory consumption. But is it ready for production? Our answer is yes! We started planning our migration in advance and were one of the first companies of our scale to deploy PHP7 to our 1000+ servers which run more then 2M lines of php code.
We hope this talk will inspire you to join us in «powered by php7» club.
11. “ A GOOD ARCHITECTURE
EMPHASIZES THE USE-CASES
AND DECOUPLES THEM FROM
PERIPHERAL CONCERNS
— Robert C. Martin
12. Clean Architecture
• Coined by Robert C. Martin
• Combination of various ideas
- Hexagonal Architecture (a.k.a. Ports and Adapters)
- Onion Architecture
- Screaming Architecture
- Data, context and interaction paradigm
- Boundary, controller entity objects
- Single responsibility principle
https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html
14. Use cases
• Use cases capture business rules
Send
Message
Bob Alice
15. What does it do?
• Structure should indicate what the application is, not how it
does it.
16. What does it do?
• Structure should indicate what the application is, not how it
does it.
com.myapp
activities
services
presenters
content providers
views
17. What does it do?
• Structure should indicate what the application is, not how it
does it.
chat
conversations
com.myapp
38. class SendMessage {
...
int execute(conversationId, ...) {
int result = mMessageGateway.send(...);
if(result == SUCCESS)
mConversationGateway.update(conversationId);
return result;
}
}
Use cases
39. class SendMessage {
...
int execute(conversationId, ...) {
int result = mMessageGateway.send(...);
if(result == SUCCESS)
mConversationGateway.update(conversationId);
return result;
}
}
Use cases
40. class SendMessage {
...
int execute(conversationId, ...) {
int result = mMessageGateway.send(...);
if(result == SUCCESS)
mConversationGateway.update(conversationId);
return result;
}
}
Use cases
41. class MessageScreenPresenter {
...
void onSendMessage(message) {
int result = mSendMessage.execute(...);
switch (result) {
case ERROR:
mView.displayError(...)
...
}
}
Presentation