Nous voulons tous devenir de meilleurs développeurs de logiciels et pouvoir nous appeler “Ingénieurs logiciels” ou “Architectes logiciels”, mais pour ce faire, vous devez d’abord maîtriser un certain nombre de modèles de conception.
Ce cours vous mettra sur une piste vers cette destination.
Nous vous apprendrons à reconnaître quand utiliser des modèles de conception spécifiques pour construire des systèmes complexes de manière à diviser pour mieux régner afin que la complexité soit réduite et abstraite.
Mais plutôt que en apprenant tous les modèles de conception disponibles, nous avons sélectionné pour vous les modèles de conception GoF les plus importants et les plus fondamentaux.
Tout cela dans le contexte du cadre Flutter utilisant Dart.
Nous commençons par une compréhension complète des principes de conception S.O.L.I.D et comment ils sont à leur tour liés à ces modèles de conception. Nous expliquons tout dans le contexte de problèmes réels ainsi que des exemples de code spécifiques.
À la fin du cours, vous apprendrez à concevoir une solution en codant le Game of Simulation de vie qui s’exécutera sur votre appareil mobile.
Les systèmes logiciels complexes sont en proie à trois problèmes majeurs :
- Les délais sont allongés à mesure que les exigences changent.
- Plusieurs développeurs ont du mal à coordonner leurs efforts.
- Redondance du code.
Cela crée à son tour des problèmes de maintenance et de flexibilité globale pour l’ajout de nouvelles fonctionnalités. En général, cela signifie des systèmes mal conçus, difficiles à entretenir et non adaptables.
Une réponse à tous les problèmes ci-dessus est d’avoir une conception et une architecture appropriées. Pensez à un gratte-ciel en construction. Il y a toujours un plan de haut niveau. Ce plan est utilisé pour montrer à toutes les personnes impliquées (des architectes à la chaîne d’approvisionnement en passant par les ouvriers du bâtiment, la planification des machines, etc.) sur quoi on travaille.
Tout le monde comprend et suit la même vision.
Un plan comporte un certain nombre d’éléments communément compris qui se répètent à travers de nombreux projets. Par exemple, tous les bâtiments ont besoin de câblage électrique et de plomberie, ils peuvent avoir besoin d’ascenseurs, de systèmes de refroidissement, de parkings souterrains et bien sûr d’escaliers. Ils sont également généralement connectés au réseau électrique et à l’approvisionnement en eau ainsi qu’aux… routes.
Tous ces éléments communs suivent certaines normes qui ont été améliorées au fil de nombreuses années et à travers de nombreux projets. Ils sont bien compris et peuvent être utilisés presque comme des recettes.
En génie logiciel, nous avons également un ensemble d’éléments qui se répètent dans de nombreux projets. Par exemple, toutes les applications logicielles doivent créer des objets, elles doivent communiquer le changement d’état entre ces objets, elles doivent pouvoir traverser des collections de ces objets. En d’autres termes, si vous voulez être un meilleur développeur, vous devez maîtriser les éléments qui ont fait leurs preuves. Dans le monde du génie logiciel, ces éléments sont connus sous le nom de “modèles de conception”
Ce cours enseignera aux étudiants comment reconnaître quand utiliser des modèles de conception spécifiques pour construire des systèmes complexes de manière à diviser pour mieux régner afin que la complexité soit réduite et abstraite.
Cela vous aidera à concevoir des projets de manière architecturale avant tout projet majeur le développement se produit et peut être utilisé pour raccourcir le temps de développement et réduire les coûts de maintenance.
Les modèles de conception sont importants car ils sont des recettes ou des solutions éprouvées pour des logiciels bien connus problèmes d’ingénierie. Lors de la création d’applications logicielles, certains problèmes se reproduisent de manière assez prévisible, donc plutôt que de “réinventer” la roue, nous aurons un assortiment de roues, si vous voulez, parmi lesquelles choisir.
Nous vous apprendrons cela dans un manière légèrement différente de celle qui vous a probablement été enseignée auparavant. Nous adopterons une approche pratique (c’est-à-dire des exemples spécifiques) mais la puissance des Design Patterns vient de leur « concept » et nous vous enseignerons le concept de ces modèles de conception afin que vous soyez pleinement en mesure de les changer et de les modifier selon vos besoins. De plus, nous verrons comment combiner tous ces modèles en quelque chose de plus grand : une architecture.
Une architecture bien conçue est cette chose magique où le tout est plus grand que la somme de ses parties.
C’est ce que nous nous efforcerons de vous apprendre.
RDV dans le cours !
Introduction
In this lecture you will learn as to WHAT design patterns are, and why we would need them. Design patterns are a crucial tool in the toolkit of a Software Engineer and we explore here why you need to become familiar with them.
In this lecture we will present to you the specific design patterns that we will cover in this course. These are in our mind the most important and fundamental of all design patterns and we will go over them in depth in subsequent lectures.
We will test here your understanding of general aspects of design patterns
Who needs Software Architecture? Why do we care about well designed and maintainable software? And how do we achieve SOLID Architecture? This lecture will show you why.
In this lecture we will show you why UML is very useful when working with design patterns and Software Architectures in general.
Final piece of the coding-well puzzle will be explored. We will appeal to you in a visual way as to why having good and organized code matters.
This is an optional lecture that you can skip if you are very comfortable with UML diagrams. In case you want a quick and gentle refresher then by all means dive in! We will do a quick overview of Class and Sequence diagrams.
What makes a Great Architecture?
How can you tell what a good Architecture is? What are the main features of a great Architecture? In this lesson we will explore the hallmarks of a great architecture are and how to spot them.
This is a very important topic. The S.O.L.I.D design principles form the backbone of what a great architecture should have at its base approach. In this lecture we explore these principles in preparation for when we go over the design patterns of this course.
NOTE: we have provided a PDF document with some exercises for you to do.
In this quiz we will test your knowledge of the SOLID Principles
Singleton Design Pattern
We introduce the Singleton Design Pattern and discuss its importance and relevance in Software Engineering. In this lesson you will learn what it is and why we need it. It is a creational design pattern that helps us with ensuring that we have only a single copy of a given class in the whole project scope. You will find out why that is relevant.
We further explore the Singleton Pattern and look into the architectural nature of this software recipe through the UML lens.
Let's code something using the Singleton Pattern. In this lesson we will explore how to code this pattern in Dart. We look at how to create a Singleton Logger wrapper in Dart/Flutter.
NOTE: attached you will find the zipped source code for this lecture.
A few questions to solidify your understanding of the Singleton Pattern and its implementation.
This is an optional exercise for the student to do. It is important to practice and try things out. This will cover two scenarios to use a Singleton Pattern in.
Factory Method Design Pattern
We introduce the Factory Method Design Pattern and discuss its importance and relevance in Software Engineering. In this lesson you will learn what it is and why we need it. It is a creational design pattern that makes the process of object creation more maintainable.
We further explore the Factory Method Pattern and look into the architectural nature of this software recipe through the UML lens.
Let's code something using the Factory Method Pattern. In this lesson we will explore how to code this pattern in Dart. We have a fun little application which draws random shapes on the screen by utilizing the Factory Method Pattern and a custom Flutter Painter.
NOTE: attached you will find the zipped source code for this lecture.
This will test some of your knowledge about the Factory Method Pattern concept.
This is an optional exercise for the student to do. It is important to practice and try things out. This will cover two scenarios to use a Factory Method Design Pattern in.
Builder Design Pattern
We introduce the Builder Design Pattern and discuss its importance and relevance in Software Engineering. In this lesson you will learn what it is and why we need it. It is a creational design pattern that makes the process of complex object creation more maintainable and decoupled from the client.
We further explore the Builder Pattern and look into the architectural nature of this software recipe through the UML lens.
Let's code something using the Builder Pattern. It's time for some Pizza! In this lesson we will explore how to code this pattern in Dart. We are going to create a Builder abstraction that will be responsible for creating different types of Pizza.
NOTE: attached you will find the zipped source code for this lecture.
This will test some of your knowledge about the Build Design Pattern concept.
This is an optional exercise for the student to do. It is important to practice and try things out. This will cover two scenarios to use a Builder Design Pattern in.
Adapter Design Pattern
We introduce the Adapter Design Pattern and discuss its importance and relevance in Software Engineering. In this lesson you will learn what it is and why we need it. It is a structural design pattern that allows two different processes to talk to each other even though their view of data is not compatible.
We further explore the Adapter Pattern and look into the architectural nature of this software recipe through the UML lens.
Let's code something using the Adapter Pattern. In this lesson we will explore how to code this pattern in Dart. We are going to create an Adapter for some XML and JSON data conversion!
As part of your Adapter pattern Exercise you will add a CSV Adapter to the featured code.
NOTE: attached you will find the zipped source code for this lecture.
This will test some of your knowledge about the Adapter Design Pattern concept.
This is an optional exercise for the student to do. It is important to practice and try things out. This will cover two scenarios to use a Adapter Design Pattern in.
Strategy Design Pattern
Let's code something using the Strategy Pattern. In this lesson we will explore how to code this pattern in Dart. We are going to look at how to create different handlers for rendering to the screen.
NOTE: The source code for this lecture is attached with this video.
This will test some of your knowledge about the Strategy Design Pattern concepts.
This is an optional exercise for the student to do. It is important to practice and try things out. This will cover two scenarios to use a Strategy Design Pattern in.
It is reccomended that you perhaps draw a UML sketch of the code (provided below) so that you can visually refactor it first.
NOTE: the code for Exercise #1 is attached below: shipping.dart
Observer Design Pattern
Let's learn something about the Observer Design Pattern in Flutter and Dart. In this lesson we will explore how this pattern is used in the setState(){ } block when we refresh widget tree contents.
NOTE: The source code for this lecture is attached with this video.
Let's learn something about the Observer Design Pattern in Flutter and Dart. In this lesson we will explore how this pattern is used in Flutter streams when we refresh widget tree contents with the ability to refresh specific branches of the widget tree.
NOTE: The source code for this lecture is attached with this video.
This is a set of exercises for the student to do. It is important to practice and try things out. This will go over the code that we have looked at in the Observer Pattern Coding (lectures #31 and #32)
You will use that code as your starting point for those exercises.
You will draw a UML Sequence Diagram for the Flutter Streams that we have covered as well as use those streams in conjunction with the Observer Pattern to modify the Grid View Code to individually target each grid tile as a subscriber to data changes.
State Design Pattern
Let's code something using the State Design Pattern. In this lesson we will explore how to code this pattern in Dart. We are going to look at how to create controller process for good old traffic lights. We will design and code the state machine for a traffic light.
NOTE: The source code for this lecture is attached with this video.
Course Assignment - The Game of Life
In this lecture we will look into the course assignment.
You will see what 'Game of Life' is all about. This is a famous and classic life simulation that is a staple of colleges and universities in their Computer Science programs for its curious 'emergent' behaviour.
You will design, architect and code this application for your mobile device. All of it using the design patterns you have learned in this course.
I have provided you with a working starter code which has all the logic for the game of life but is not architected well. Your task will be to take the code and refactor it so that it is well architected and follows all the SOLID principles as well as uses some of the Design Patterns we learned in the course.
NOTE: The source starter code for this lecture is attached with this video.
A helping hand with the architecture and general 'design' approach for your assignment.
Final Thoughts
Some final thoughts about what you could do next after this course.
Thank you for being part of this course. We hope to see you again! Good luck with everything!