Factory Design Pattern

When we code using OOP paradigm, we might have to deal with creating objects of classes, which implement a common interface or extend the same class. In this situation, it is recommended to use a Factory pattern. What it basically does is, that it takes on the responsibility of creating objects, making this process more generic and consequently, more clear and readable.

Continue reading “Factory Design Pattern”

SOLID Printsiplari (II-qism)

Liskovning Almashinuv Printsipi

Bu printsipga asosan: ‘Har qanday klassdan meros olgan klasslar, uning hususiyatlarini va hulqini o’zida o’zgarishsiz aks etishi lozim’. Yani, agarda biz ota klassning obyektlari o’rniga, voris klassnikining joylashtirsak, dasturimiz o’zgarishsiz ishlay olishi shart. Ushbu printsip tushunishga bor oz murakkab bo’lishi mumkin, lekin, quyidagi misol unga oydinlik kiritadi degan umiddaman.

Continue reading “SOLID Printsiplari (II-qism)”

SOLID Printsiplari (I-qism)

SOLID printsiplari, Obyektga Yo’naltirilgan Dasturlashda ishlatilinadigan asosiy dizayn tamoyillaridan biridir. SOLID so’zi u qamrab olgan beshta printsiplarni bosh harflaridan tashkil topgan:

1. Single Responsibility Principle (Yagona Javobgarlik Printsipi);

2. Open-Closed Principle (Ochiqlik-Yopiqlik Printsipi);

3. Liskov Substitution Principle (Liskovning Almashinuv Printsipi);

4. Interface Segregation Principle (Interfeysni Ajratish Printsipi);

5. Dependency Inversion (Qaramlikni Qaytarish).

Continue reading “SOLID Printsiplari (I-qism)”

Why do we need encapsulation?

If you have been dealing with OOP lately, you may have heard about encapsulation. Its the one of the principle mechanisms of object-oriented design, which restricts access to a class’s properties and allows you to manage a data flow. These are done with the use of access specifies: private, protected and public, which are supported in most programming languages.
Continue reading “Why do we need encapsulation?”

Dasturchilar uchun o’nta tavsiya

Hammaga salom!

Men, bir-qancha tajribasi bor dasturchi sifatida, sizlarga foydali bo’lishi mumkin bo’lgan tavsiyalar bermoqchiman. Sizning tajribangiz qanchalik ko’p bo’lsa, quyidagi keltirilgan tavsiyalarning shuncha ko’pi sizga haqiqiy va banal ko’rinadi. Dasturlash sohasiga endi kirib kelayotgan dasturchilar uchun esa bu tavsiyalar juda g’alati tuyulishi mumkin.

Continue reading “Dasturchilar uchun o’nta tavsiya”