SDD - Squad Driven Design
Ahmed Adel Ismail
Engineering Manager @ Yassir | x-SadaPay | x-Swvl | x-Talabat | x-TryCarriage | x-Vodafone | More than a decade of experience in Android development and teams leadership
Working in multiple big teams I've found that we are always trying to apply our known best practices in software, but we always reach this point where there is a bottle neck in our code base related to multiple squads working together ... lately I've seen the same pattern repeating over again and again, for the last 3 companies that I've worked in to, they were inspired by the "spotify model" and they started with it and then tried to invent there own variation of it, specially when it comes to Mobile Project Architecture and how to reflect the Squad's into code base
So I'm trying to share the conclusion that we have come to when it comes to big Android projects owned by multiple squads
And since our main concern was to apply best practices to deliver the business value in a Squad based teams, I believe this approach should be oriented about how we design our software when we have multiple squads are involved, or in other words ... Squad Driven Design
The Objective of SDD
Architecture Levels
In this Architecture our project is divided into 4 levels (or groups), each one of them abide to certain rules ... and for each squad they follow these rules based on what level (or group) they are implementing there code in to
Application Level
At this level, only the Application module belongs to it, and the rules that should be follows in this level are
Implementations Level
This is the second Level in the Architecture, and in this Level Squads focus on putting there implementations (most day to day work), the rules that should be followed in this level are
APIs Level
As Squad's modules do not interact with each other on the Implementation level, Squads declare API modules in this APIs level so that they can interact with each other, the rules that should be followed in this level are
领英推荐
Dependencies Level
And this level is simply the dependnecies declared in the dependencies catalog, weather these dependencies are native libraries like kotlin version, or 3rd party libraries like networking libraries ... but there is no lines of code created by any squad in this level ... it is limited to external code that is not maintained by any squad
As we have gone through the concept of Squad Driven Design, this is a simple examlpe for a multi squad project, showing the critical points of this architecture
Application Level
@HiltAndroidApp
class MyApp : Application() {
// ...
}
@AndroidEntryPoint
class MainActivity: AppCompatActivity(){
// handle navigation here between squad's composables or fragments,
// or even Activities
}
Implementations Level
Squad one module
@Module
@InstallIn(SingletonComponent::class)
interface SquadOneModule{
@Binds
fun bindSquadOneApi(impl: SquadOneImpl): SquadOneApi
//...
}
class SquadOneImpl(val squadTwoApi: SquadTwoApi) : SquadOneApi {
//...
}
Squad two module
@Module
@InstallIn(SingletonComponent::class)
interface SquadTwoModule{
@Binds
fun bindSquadTwoApi(impl: SquadTwoImpl): SquadTwoApi
//...
}
class SquadTwoImpl(val squadOneApi: SquadOneApi) : SquadTwoApi {
// ...
}
APIs Level
Squad one API module
interface SquadOneApi {
// ...
}
Squad two API module
interface SquadTwoApi {
// ...
}
The focus in the above exampes is how squads do integrate with each other, without depending on each other's implementations
For simplicity we assumed that each squad has one implementation class and one API interface, but in reality the squad will have a whole sub-project and provide the implementation classes only when they declare APIs
There is much more to SDD than the mentioned above, and what ever is not mentioned here can be implemented differently from team to team, but I hope that this gives a hint about this approach generic application in most of the teams
Product Manager| Fintech Expert| SDLC Management | Agile Methodology|Digital payments
4 个月mohammed sadeq Marwa Mahmoud
We follow SDD methodology at VOIS and it's fantastic when works on lagre scaling project with large number of engineers