Programming ∀
Open in Telegram
Ushbu kanalda IT va Dasturlashga aloqador mavzularda subyektiv fikrlarimni bayon qilaman.
Show more1 217
Subscribers
No data24 hours
-87 days
-3530 days
Posts Archive
1 217
Repost from N/a
GRASP
GRASP stands for General Responsibility Assignment Software Patterns / Principles. This article is dedicated to covering this topic. Today, most new developers talk about S.O.L.I.D principles blindly. I think they just learn this principle to pass interviews successfully. Before the S.O.L.I.D principle, there was a really popular perception called GRASP. It was dominant at the very time. Most developers today don't know about the principle and event they have never heard of it.
So what is GRASP? This principle includes several patterns including Creator, Information Expert, Low coupling, Controller, High Cohesion, Indirection, Polymorphism, Protected Variations, and Pure Fabrication. In this article, I will try to cover some of those which are mostly used. It is a suite of guidelines and principles used to design OO software and assign responsibilities to different classes and objects. These principles help developers build maintainable, flexible and understandable software systems by specifying clear roles and responsibilities to objects.
Creator Pattern. This principle states that classes should be responsible for creating other instances of another class if they have the necessary information to do that. This helps you remove unnecessary dependencies between classes. One example of this pattern is the factory pattern. Because this pattern will have any information to instantiate the instances of the class. Another example is order and line items. Line items should be created by order. Because none of the other classes would have information about the line item. (You might have noticed that the aggregate principle in DDD follows that principle).
Information Expert. You have to assign a responsibility to the class that has the most information required to satisfy that responsibility. It helps you decide where should put the responsibility. Above example suite for this one. For example, the total count of line items can be gathered through order instead of line item. This principle makes finding a place where is the best to do things easier.
Controller. This principle states that you have to assign the responsibility of managing and coordinating user actions to a dedicated controller class. It is all about the coupling and separation of concerns. I would say that correctly implemented layered and component-based architecture is an example of this pattern. Because domain objects shouldn't be dependent on some kind of layers. For example, you should be able to migrate from one database to another without worrying about other layers. Just you have to change only the persistence layer.
Low Coupling, High Cohesion. I don't want to write about those principles again, because if you scroll up, you can see two separate articles that cover those principles.
Protected Variations. Protect variations in the system by encapsulating the parts that are likely to change. This principle helps isolate changes and their impact on the rest of the system. Before I learned this principle, I had learned a kind of thing called "Encapsulate what varies". This helps to isolate things and reduce the impact of one thing on another one. This kind of thing is accomplished by using abstractions. You can think of this principle as the Single Responsibility principle of the S.O.L.I.D.
Indirection. Introduce indirection or intermediate classes to decouple two classes that should not directly depend on each other. This principle helps avoid direct dependencies, making the system more flexible. This is also done by putting abstractions. This principle provides you with low coupling.
Pure fabrications. It states that if you cannot find a place to put objects, it is a good idea to follow this principle. Create artificial or "pure fabrication" classes to centralize complex behavior not fitting into other classes. If you cannot find the place where your objects can stay, just create a separate component, module or something which has enough information to accomplish the result.
@usmonmasudjonov
1 217
FaceIT Smurfinga qarshi kurashish uchun foydalanuvchilarni identfikatsiya qilishni yo'lga qo'yibti.
Endilikda siz o'yin o'ynashingiz uchun ham passport ma'lumotlaringizni taqdim qilishingiz kerak 🙂
Bunday xabardan keyin jiddiy o'ylab qoldim insonlarning shaxsiy ma'lumotlari haqida...
1 217
Serverga kirishingiz uchun VPN kerak. Ammo VPN sizning internet provider tomonidan bloklangan.
VPN qo'yish ✅
1 217
Interviewlarga tayyorlanmaslik haqida 2 yil oldin aytgan edim. Kanalda qachon aytganim esimda yoq. Ammo ko’pchilik orasida gapirganimga afsuslantirishgan edi 😅
OOPni hozirgi tillardagi rasvo realizatsiyasini kop yoritishga xarakat qildim. Bu masalada yangi nuqtalarni shakillantirish edi maqsad 🫠
Shu o’rinda Jamiyatdagi yana bazi masalalarni izohlab ketmoqchiman.
Fikr bildirish va tanqidiy, ratsional, taxliliy fikrlash masalalarida manimcha ustimizda ishlashimiz kerak. Man tanqidni rivojlanish asosi deb bilaman. Heyterlik va tupikga tiqish esa boshqa masala. Bular prinspial yoki qanaqadur notogri talqinli reactionlar.
Har qanday fikr va qarshi fikrlar o’rtaga tashlanganda hulosa va yechimlar umuman olganda nimadur maqsad bo’lishi kerak. So’ngi discusslardan va hodisalardan tushunganim bizda bular o’rniga tupikga tiqib mazza qilish va shu sabab suniy reputationga erishish kabi maqsadlar ko’zlanganday tuyildi.
Yana bilmadim balki manda perfectionistic krizis bo’layotgandur. Ammo tahlillarim shunga olib keldi. Fanda tanqid qarshi fikr va solution review processlar bo’ladi. Bunday narsalarga yoki professional yondoshish yoki uzoq turish afzal.
Manga so’ngi paytlar uzoq turish afzal ko’rinyabti. Tingchina o’z tajribalarimni qilib yuraman hakuna matata…
1 217
Repost from Engineering Notes
Yolg'onlar shahri
O'ylab qarasam, jamiyatda mumkin bo'lgan hamma sinovlarni aldab, aslimizdan ko'ra yaxshiroq ko'rinishga harakat qilish normaga aylanib bo'libdi.
Abituriyent bo'lib fanni o'rganishga emas, qanday qilib testda ko'proq ball yig'ishni o'rganishga harakat qilamiz. Vaholanki, testning maqsadi aslida fanni qanchalik bilishni tekshirish bo'lishi kerak. Universitetga kirgandan keyin nima bo'lishi esa qiziq emas.
Ingliz tilini emas, IELTSda qanday qilib yuqori ball olish "sirlari"ni o'rganamiz. IELTS 7-7.5 ball olib qo'ygan, lekin eplab inglizcha matn o'qiy olmaydiganlar oramizda ancha ko'payib qoldi.
O'qishda butun semester davomida fanni emas, 2 kun oldin imtihondan qanday yaxshiroq ball olishni o'rganamiz. Fan nega o'tilayotgani umuman qiziq emas.
Hayotda yaxshiroq odamga aylanishga emas, uchrashuvda yaxshi odam bo'lib ko'rinishga harakat qilamiz. Turmushdan keyingi hayot ikkinchi darajali.
Ishda kerakli bilimlarni o'rganishga emas, kirish intervyularini qanday qilib "yorib tashlash"ni o'rganamiz. Yana bunda psixologiyadan tortib statistikagacha hamma narsani ishga solamiz. Intervyudan zo'r o'tib keyin ishni eplay olmayotganlar normal qabul qilinishni boshladi (yaqingacha o'zim ham shu toifada edim).
Mening fikrimcha esa imtihonlar "qozonda bori cho'michga chiqadigan" vaqt bo'lishi kerak.
Kimni aldayapmiz? Jamiyatnimi? Yaqinlarimiznimi? Yo o'zimiznimi?
O'ylab ko'ring.
P.S. Non-technical post uchun uzr.
1 217
Mutability mavzusida:
I/O dan quyi qatlamni barchasi immutable bo'la oladi !. OOPda ham FP da ham. Uni amalga oshirish sizning skill va hohshingizga bogliq.
1 217
Agar siz rostdan ham kelajak kasblariga ega chiqmoqchi bo'lsangiz. O'quv markazlarga pul berib yurmang.
Yaxshiroq universitetga topshiring chetga. Master + PHD qiling undan keyin ma'lum tor yo'nalishda ishlaydigan yangilik qiling :)
Markazni bitkazib qandayrud joyga ishlashigiz bu kelajak emas :) Keyin siz kamida yaqin 4-5 yilda kelajak emas tarixni o'rganasiz.
1 217
AI borasida manga eng qiziq mavzulardan biri. DevOps assistant AI.
Barcha routine ishlarni shunga bervorsak bo’ladi qulday ishlatamiz.
Ayniqsa bazi troubleshooting vazifalarni qilishga zorda.
AI mavzusida expriementlarga idea topolmayotganlar uchun marhamat.
Ops ishlarni anchasini AIga yuklab o’zimiz CS bilan shugullansak bo’ladi 🙂
1 217
Roadmaplardan oldin qilishiz kerak bo’lgan ish bor.
Ertalan uyg’onganizda.
Bugun nima o’rganaman ?
Kechasi uxlashdan oldin potolokga qarab yotganizda.
Bugun nima o’rgandim ?
Shu ikkala savolga javob topish kerak nazarimda
1 217
Common design patterns at Wordpress
Common design patterns at work.
Common design patterns at cringe situation 😁
