Tools for your Design Toolbox
Encapsulate what varies.
Favor composition over inheritance.
Program to an interace not implementation.
Strive for loosely coupled designs between objects that interact.
Classes should be open for extension but closed for modification.
Depend on abstractions. Do not depend on concrete classes.
Define a family of algorithms, encapsulates each one, and makes them interchargeable. Strategy lets algorithm vary independently from clients that use it.
The Observer Pattern defines a one-to-many dependency between objects so that
when one object changes state, al of it's dependents are notified and updated automatically.
The Decorator Pattern attaches additional responsabilities to an object dynamically.
Decorators provide a flexible alternative to subclassing for extending functionality.
The Factory Method Pattern defines an interface (abstract or simply a class) for creating objec, but lets subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.
Provides an interface for creating families of related or dependent objects without specifying ther concrete classes.
Ensures a class has only one instance and provides a global point of access to it.
- git init -> create local repo.
- git add . -> add all files added or modified.
- git commit -m "first commit" -> create a new commit with message.
- git remote add origin https://github.com/LearningProcesss/cppOop.git -> add remote repo to the local.
- git push -u origin master -> save commit to the branch.
Feature branching workflow
Create new branch from master
git checkout master
git checkout -b <feature_branch>
Check actual branch
Check files added or modified
git add .
Add any numbers of commit
git commit -m "adding a change from the feature branch"
Push branch to origin
git push origin <feature_branch>
Merge feature_branch in master
git checkout master
git merge --no-ff <feature_branch>
git push origin master
git branch -d <feature_branch>
git push origin --delete <feature_branch>