[WP] 03.02.2023 | oop principles

 Today i have been reading about design patterns. A lot of effort was put into revise basic OOP terms/concepts. Encapsulation(behavior reuse), inheritance, polymorphism, abstraction overriding, overloading, adding new instance variables. Contract – rules for methods overriding, function signature, access levels(default, public, private, protected). I learned that only methods may be overriden. On the other hand instance variables may be re-assigned but it happens rarely.

inner class is a class defined within another class; (non-public class). End of inheritance line may be explicitly stated with final keyword(java)


Polymorphic arrays, return values and arguments was a piece of great discovery to me.


Basically polimorphism is possible because subtypes inherit types of all supertypes – ergo every time supertype was used as a reference somewhere in code one of its subtypes may be placed there instead of parent.


Defining super class developer specifies contract/protocol that says „all my subtypes are able to do this …”- In other words it specifies common protocol for a group of classes.


inheritance tree; inheritance hierarchy; B extends A D implements C A has <some methods>


specific vs generic.

common code, client code.


reusable, extensible, maintainable.


OO basics: Abstraction, Encapsulation, Polymorphism, Inheritance


OO principles: Encapsulate what varies, Favor composition over inheritance


program to interfaces not implementation.


OO Patterns: Strategy – defines a family of algorithms, encapsulates each one and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.


Resolving minor problems with 1st project react app deploy on netlify was very rewarding experinece i Im relieved now when sync with github repo is working smoothely


The problem with build was connected with one of environmental/process variable which caused warnings to be treated as errors thus netlify build was unable to complete.


–Edit:

add environmental variable CI=false to avoid build failure of project with eslint warnings.


Stay Tuned

g-marcin

Komentarze

Popularne posty z tego bloga

[WP] 23.06.2023 | subjects

15.07.2024 | simplicity

[WP] 05.06.2023 | angular-intro