Data Abstraction-Show relevant data
Hiding of information
How to implement in code.
The visibility of a
property, a method
or (as of PHP 7.1.0) a
can be defined by prefixing the declaration with the keywords public, protected or private.
Class members declared public can be accessed everywhere. Members declared protected can be accessed only within the class itself and by inheriting and parent classes. Members declared as private may only be accessed by the class that defines the member.
But how to access private member?
Getter and setter
in magic function in PHP
5.Internal (built-in) functions
Functions that are written by the user are User defined functions.
function names starting with
__ as magical
In PHP The function names
clone() and __debugInfo()
are magic function/methods
The system is the collection of
and modules contain
and each and every component have a
-Without effecting remaining components we can modify any component.
is best for a module.
1.Degree of dependency between the two module.
2.Loose coupling/decoupling is best.
3.Coupling is a measure of the quality of a design. The objective is to minimize coupling between modules, i.e., make modules as independent as possible.
How to make High Cohesion and loos coupling system(HCLC)
Encapsulating and Information Hiding
declare them as private and provide access using
get & set methods
Common coupling (also known as Global coupling) occurs when two modules share the same global data (e.g., a global variable). Changing the shared resource might imply changing all the modules using it.
Profit of HCLC system
1.improve maintainability of system.
1 Programming concept