Please enable JavaScript.
Coggle requires JavaScript to display documents.
Programing (3.OOPS (Principles (Data Abstraction-Show relevant data…
Programing
3.OOPS
Principles
Data Abstraction-Show relevant data
Interface
abstract
Inheritence
Polymorphism
information hiding
Encapsulation
Hiding of information
How to implement in code.
Visibility
The visibility of a
property, a method
or (as of PHP 7.1.0) a
constant
can be defined by prefixing the declaration with the keywords public, protected or private.
ACCESS
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
Concepts
Class
Methods
1.User-defined functions
2.Function arguments
3.Returning values
4.Variable functions
5.Internal (built-in) functions
6.Anonymous functions
1.User-defined functions-
Functions that are written by the user are User defined functions.
Properties
object
#
Magic Methods
function names starting with
__ as magical
In PHP The function names
construct(),
destruct(),
call(),
callStatic(),
get(),
set(),
isset(),
unset(),
sleep(),
wakeup(),
toString(),
invoke(),
set_state(),
clone() and __debugInfo()
are magic function/methods
OOD
2.System Design
Cohesion
-for image
clickme
The system is the collection of
modules
and modules contain
components
and each and every component have a
function(task)
.
Aim
-Without effecting remaining components we can modify any component.
High Cohesion
is best for a module.
Coupling
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)
1.Use
Encapsulating and Information Hiding
declare them as private and provide access using
get & set methods
.
2.less
global variable
-Why?
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.
2.increase reusability.
4.SOLID Principles
1 Programming concept
5.Design Patterns
6.Architecte pattern
https://softwareengineering.stackexchange.com/questions/299836/difference-between-3-tier-architecture-and-mvc-model-view-controller-in-asp-n