پی اچ پی

اصول شی گرایی در PHP

Object-Oriented Principles in PHP

The typical beginner, whether they realize it or not, first learns procedural programming. But, before too long, they level up. Suddenly, an entirely different paradigm is introduced: object-oriented programming. Little do they know that they'll spend years researching and learning exactly what it means to work with objects and messages.

In this series, you'll be introduced to the core principles of object-oriented programming in PHP. We'll begin with the basic constructs and work our way up.

سطح متوسط 9 جلسه آموزشی 01:33:00 ساعت
01
قسمت 1

کلاس ها

اجازه دهید با معرفی کلاس ها در زبان PHP شروع کنیم. من کلاس ها را به عنوان الگویی در نظر می گیرم که ساحتار و رفتار کلی یک کانسپت را در کد تعیین می کند.

02
قسمت 2

اشیا

If a class is the blueprint, then an object is an instance (or implementation) of that blueprint. In this lesson, you'll learn how to create multiple instances of a class, how to define and set internal state, and how to declare static constructors t...

03
قسمت 3

ارث بری

Inheritance allows one class to inherit the traits and behavior of another class. This should instantly make sense, in the same way that a child inherits characteristics from their parents. In this lesson, we'll review several examples of inheritance...

04
قسمت 4

کلاس های انتزاعی

An abstract class provides a template - or base - for any subclasses. In this lesson, we'll work through an example that demonstrates how, why, and when you might reach for an abstract class.

05
قسمت 5

Handshakes and Interfaces

Think of an interface as a class with no behavior. Instead, it describes the terms for a particular contract. Any class that signs this contract must adhere to those terms. Let's review this idea using the example of a newsletter signup.

06
قسمت 6

کپسوله سازی

Encapsulation allows a class to provide signals to the outside world that certain internals are private and shouldn't be accessed. So at it's core, encapsulation is about communication.

07
قسمت 7

ترکیب و انتزاع اشیا

Let's move on to object composition. To break it down into the simplest of terms, composition is when one object holds a pointer to another object. This allows us to construct complex functionality by combining various types.

08
قسمت 8

اشیا و تغییر پذیری

A value object is an object whose equality is determined by its data (or value) rather than any particular identity. To illustrate this, imagine three five dollar bills resting on a table. Does one bill have a unique identity compared to the other tw...

09
قسمت 9

استثناها

Any time your code encounters an unexpected condition that it can't handle, an exception should be thrown. In this lesson, we'll review the "why, how, and when" of exceptions, as well as some interesting ways to improve readability through naming and...

دوره در حال اجرا

این دوره هنوز به پایان نرسیده است و در آینده درس های دیگری به آن افزوده خواهد شد.