As usual awesome senior crowd and thanks for friends who travelled from Indore to attend the design pattern session in Mumbai.
A quick revision about what we learnt in the class: –
- Design pattern should be applied naturally. Any artificial implementation leads to bad architecture.
- Design pattern, Architecture pattern and Architecture style are three different things.
- DDD is an approach where we ensure that we follow domain. So, if in domain we have “Bank” in our code we have a “Bank” class or object.
- Ubiquitous language means both development team and business team should follow same vocabulary. There should not be synonyms while discussion. So, for example if you user is using the word “itenary” and developers are using “path” it just causes confusion.biquitous language means both development team and business team should follow same vocabulary. There should not be synonyms while discussion. So, for example if you user is using the word “itenary” and developers are using “path” it just causes confusion.
- There are 3 types of classes Entity, Value and Service.
- Entities and Services classes are straight forward but for value objects you need to implement “gethashcode” , operator overloading and by overriding “equals” method.
- In Aggregate root all execution happens via a central root object.
- Iterator pattern helps to loop through the aggregate root collection with out violating aggregate root integrity and validation.
- Four diagrams of UML are must Use cases, activity, class diagrams and sequence diagram. Use case and activity are used in requirement document and class diagram and sequence diagram is used in technical design phase.
- Factory pattern has three flavors simple factory, factory pattern and abstract factory.
- Simple factory pattern is nothing but one polymorphism and putting new keyword in a central location. Simple factory pattern has one factory class which has new keyword and the objects are referenced via interfaces.
- In Factory pattern the object creation process is delegated to subclasses. The objects are referenced via common interfaces.
- Abstract factory pattern helps to put factory pattern in to same families so that factories become manageable.
- Decorator pattern helps to add behavior dynamically to a class without altering the class. Its implemented by using linked list and chaining via constructor.
- In template pattern we have fixed sequence steps in the parent class and later the subclasses can define how the individual sequence steps should behave but cannot alter the sequence.
- Façade they help us to simplify a subsystem interfaces.
- Bridge pattern helps to implement decouple abstraction from encapsulation. Remember the example of “Customer” and “Lead”.
- CQRS says that model for updating / inserting and delete should be different from the model which reads even though it violates reusability. DTO and reporting objects are one of the indirect ways of implementing CQRS.
- Prototype helps to clone objects. “Memeberwiseclone” method is used in .NET to do shallow cloning for deep cloning we need to use serialization or every class should implement the clone method. Legal cloning means the class create the clone and illegal means its created from outside.
- Adapter pattern helps to make classes work together which they would not have because of incompatible interfaces. Adapter pattern comes in two flavors class level adapter pattern and object adapter pattern.
- Flyweight pattern is used to store objects internal state so that we can revert to the original state when needed. This pattern can be simplified by using prototype pattern.
- Repository pattern is a layer which binds the model and the data layer. It included things like in-memory operation, mapping code, caching, transaction and so on. By this we can change the data access layer technology with out disturbing the model code.
- UOW (Unit of work) helps to implement transaction in repository.
- Singleton pattern is not about just making classes static it should also implement features like thread safety, lazy loading, safe iteration and so on.
- Mediator pattern helps to simplify complex communication between many objects by acting as central communicator between objects.
- Command pattern helps us to treat command as objects. With this thought we can implement things like undo and redo an action.
- Interpreter pattern interprets grammar and executes logic for the grammar. The thought here is that every grammar word has a class and then the classes are sequenced while execution.
- MVC , MVP and MVW are GUI architecture patterns. The whole goal here to put UI binding code in to a class. There are different names from different technology section. So in ASP.NET they call it MVC , WPF calls in MVVM. MVP is a pattern which is used more with Webforms.
- Proxy pattern is implemented using WCF , Web service , Web API in todays modern programming world.
- Visitor pattern , state pattern and observer are less used patterns.
- Estimation using FPA (Function point analysis) is more scientific than using WBS. In FPA we count EI/EO/EQ/EIF and then come out with an estimation.
The complete syllabus of design pattern can be found at http://stepbystepschools.net/?page_id=319
Kindly conduct this session in NCR .
View CommentHello Ruchir,
Thanks for showing interest. We will inform you if we plan to conduct batches in future at NCR region.
Thank you,
View Comment