Apply SOLID principle at Door code example#133
Open
tonicospinelli wants to merge 1 commit intokamranahmedse:masterfrom
Open
Apply SOLID principle at Door code example#133tonicospinelli wants to merge 1 commit intokamranahmedse:masterfrom
tonicospinelli wants to merge 1 commit intokamranahmedse:masterfrom
Conversation
Many examples on the internet of software engineering didn't apply the SOLID principle correctly. Considering the Doors could be made in many kinds of materials, it sounds more like an Abstract class. The changes there introduced will be explained over the SOLID principle: * A Measurable Interface is a behavior expected for all objects which have dimensions, fitting to the Interface Segregation Principle. * Abstract Door has dimensions and requires a material to be built. It is a requirement for the Single Responsibility Principle. * Wooden Door is the concrete implementation over Door abstraction where defines its material and dimensions. This is an example of the Open/Close Principle.
Author
|
thanks to create this repo, here is my quick and humble contribution. |
|
@tonicospinelli great participation, but one notice |
Author
|
@abdallahisham, I understand your point. You are probably looking at the code on the SOLID principles aspects. I invite you to look at the code on the Object-Oriented approach. The Door is an abstract object with measures, and the WoodenDoor is a concrete object that never will be a MetalDoor. Now, does it make sense? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Many examples on the internet of software engineering didn't apply
the SOLID principle correctly. Considering the Doors could be made
in many kinds of materials, it sounds more like an Abstract class.
The changes there introduced will be explained over the SOLID
principle:
have dimensions, fitting to the Interface Segregation Principle.
It is a requirement for the Single Responsibility Principle.
where defines its material and dimensions. This is an example of the
Open/Close Principle.