This series will take you from the very basics (what is OOP) through all the main features and benefits of OOP, to advanced methods of how to use OOP. We'll demonstrate all the options using real-world examples.
Page in progress!
use in inheritance and abstract class
Page in progress!
Class, object, service, entity, value-object
Page in progress!
use of constants
constructor
parameters
Exceptions are the tools of Object Oriented Programming, which provides an elegant way to throw and handle (treat) application errors.
An exception is first thrown (thrown), treated (try), and caught (catch). Only throwing is mandatory.
Philosophy…
One of the fundamental properties of Object Oriented Programming is inheritance and encapsulation. With these features, you will be able to easily build complex application logic while maintaining good implementation readability.
The principle of…
There's a famous joke that programmers start using frameworks only when they write their own and find that it goes nowhere. The funny thing about this is that it's true. I've experienced it myself. Twice, even.
However, the main page of Nette says:
…
One of the main principles of OOP is the encapsulation principle, which says that complex problems should be broken down into many small problems that we can solve independently and simultaneously. At the same time, we as users don't care how it…
Methods represent the behavior of an object because they allow you to work with its internal state as well as to influence objects with each other.
Representing methods in the real world
Consider any real-world object, say a cat. The cat has certain…
Design patterns are ways of thinking about programming.
They provide a collection of advice, ready-made practices, best-practices and insights into development. For each programming paradigm and task type, there are certain design patterns that are…
I'm sure you know this, when programming PHP scripts we split the code into many files and to have all the parts available we load them with a series of include, require or preferably require_once calls, which guarantees loading just once.
In the…
Object-oriented programming is a paradigm, a view of how to program. You'll soon see for yourself that OOP brings a pretty fundamental simplification to all the common problems and difficulties that are solved over and over again in real programming…
Welcome to the first article of the online course OOP in PHP. For a complete list of articles, visit the overview page.
Content notes:
The goal of this series is to best explain the essence of object-oriented programming so that you don't have to…