Template Method Pattern

Template ဆိုတာကတော့ ကျွန်တော်တို့တွေ ကြားနေကြပါ။ ပုံမှန် အားဖြင့် အရန်သင့်ရှိပြီးသားထဲကမှ လိုအပ်သည့် အပိုင်းလေးကိုပဲ ပြင်ပြီး သုံးတာပါ။ Template Method Pattern ကလည်း အဲလိုခပ်ဆင်ဆင်ပါပဲ။ Template Method Pattern က Behavioral Patterns တစ်ခုပါ။ Class Diagram ကို ကြည့်ရအောင်။ Java code က abstract class FileOpener { private String filePath; public FileOpener(String filePath) { this.filePath = filePath; } // Template method that defines the steps for opening the…More

Strategy Pattern

Strategy pattern က behavioral design pattern တစ်ခုပါ။ Strategy Pattern အကြောင်းပြောရရင် ပြဿနာ တစ်ခု ကို ဖြေရှင်းဖို့ အတွက် နည်းလမ်း မျိုးစုံ ရှိပါတယ်။ အဲဒီ နည်းလမ်းထဲက ဘယ် နည်းလမ်း နဲ့ ရှင်းမလဲ ဆိုတာကို ပြောပြပေးလိုက်တာပါပဲ။ ဥပမာ Google Map မှာ Point A ကနေ Point B ကို သွားမယ်။ အဲဒီ အခါမှာ သွားဖို့ Strategy တွေက ကား နဲ့ သွားမယ် လမ်းလျှောက် သွားမယ် bus နဲ့ သွားမယ် ဆိုပြီး strategy ရှိလာပါတယ်။ Strategy ပေါ်မှာ…More

Command Pattern

Command pattern က behavioral design pattern တစ်ခုပါ။ Text-Editor app တစ်ခု ဖန်တီးသည့် အခါမှာ toolbar မှာ buttons တွေ အများကြီး ရှိပါ မယ်။ Copy, Paste, Undo, Redo စသည့် button တွေ အများကြီး ရှိပါတယ်။ Save လုပ်ဖို့ အတွက် Button ကနေ ရှိနိုင်တယ်။ Menu ကနေ ရှိနိုင်တယ်။ Shortcut ကနေလည်း ရှိနိုင်ပါတယ်။ Button တစ်ခု ဆီကနေ function ခေါ်မယ့် စား SaveCommand ဆိုပြီး command pattern နဲ့ ရေးတာ ပိုအဆင်ပြေပါမယ်။ ပုံမှာ ဆိုရင်…More

Facade pattern

Facade Pattern က Structural-Pattern တစ်ခု ဖြစ်ပါတယ်။ သူက တံခါးပေါက်နဲ့ တူပါတယ်။​ System အကြီးရဲ့ အောက်မှာ sub system တွေ ရှိနေပြီး သူတို့ကို Service Class ကနေ တဆင့်ခိုင်းစေတာပါ။ Laravel က Facade နဲ့ Facade Pattern က မတူပါဘူး။ ဥပမာ နားလည်အောင် အောက်က Diagram ကို ကြည့်ကြည့်ပါ။ HomeTheaterFacade က main system ဖြစ်ပြီး သူ့ဆီမှာ sub system တွေ ဖြစ်သည့် DVD Player, Projector, Sound System တွေ ရှိနေပါတယ်။ ကျွန်တော်တို့ ဘယ် DVD…More

ကျွန်တော် ဘာလို့ Monolithic ပဲ ရွေးချယ်တာလဲ

Microservice နဲ့ ပတ်သက်ပြီး developer တွေ မေးနေကြတာရှိတယ်။ Microservice ဆိုတာ ဘာလဲ။ သိဖို့ လိုလား။ ပြောင်းသင့်လား။ သုံးသင့်လား ဆိုပြီး။ ဘယ်အရာ မဆို pros and consရှိတာပဲ။ အခု အချိန် ထိ Microservice နဲ့ Monolithic ဆိုရင် Monolithic နဲ့ ပဲ အမြဲစ ဖို့ပဲ အကြံပေးတယ်။ Monolithic ကိုပဲ ရွေးချယ်ဖို့ ဆုံးဖြတ်တယ်။ Monolithic က ခေတ်မရှိတော့ဘူး။ Netflix တို့ Facebook တို့ Microservices တွေ နဲ့ ရေးနေကြတာ ကျွန်တော်တို့ လည်း ရေးသင့်တယ်။ သိထားသင့်တယ် လို့ ထင်ကောင်းထင်ကြတယ်။ သိထားတာကတော့ သိထားသင့်တယ်။…More

Caddy Snippet

Caddy snippet လေးတွေ ဖန်တီးထားပြီး သုံးရတာ တော်တော်အဆင်ပြေတယ်။ ရေးရတာလည်းလွယ်တယ်။ အခုလက်ရှိ လုပ်ထားသည့် snippet တွေကို ဒီမှာ လာမှတ်ထားတာပါ။ Laravel-App (laravel-app) { {args.0} { # Resolve the root directory for the app root * {args.1}/public log { output file /var/log/caddy/{args.0}.access.log { roll_size 100mb roll_keep 30 roll_keep_for 720h } format console level DEBUG } # Provide Zstd and Gzip compression encode zstd…More

GlobalProtect ကို Mac App မှာထွက်နည်း

Mac မှာ Global Protect VPN က ထွက်လို့မရပါဘူး။ နောက်ပြီး computer ဖွင့်ဖွင့်ခြင်း အမြဲတက်လာလို့ အဆင်မပြေပါဘူး။ ဒါကြောင့် ထွက်ချင်ရင် launchctl unload /Library/LaunchAgents/com.paloaltonetworks.gp.pangp* ပြန်ဖွင့်မယ် ဆိုရင် launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangp* နောက်တချက်က GlobalProtect VPN က https certificate trusted မဟုတ်ရင် အလုပ်မလုပ်ပါဘူး။ firefox ကနေ certificate ကို manual download ချ။ keychain မှာထည့်ပြီး trusted ပေးထားဖို့ လိုပါတယ်။More

ကလေး

2021 မှာ ပြဿနာ မျိုးစုံ ကြောင့် ဖွင့်ထးသည့် ရုံးခန်းက ပြန်ပိတ်ပြီး work from home ပဲ လုပ်နေရတာ အခု ထက်ထိပဲ ။​ ကောင်းတာကတော့ ကလေးတွေ ကို ပို အချိန်ပေးလာနိုင်ပြီး ပို နားလည်လာနိုင်တယ်။ ကလေးတစ်ယောက်က မိဘ ကို လိုချင်တာ မရလို့ ပြန်ပြောရင် သူလိုချင်တာကို သူဖြစ်ချင်တာကို ပြောရင် မြန်မာတွေက ရိုင်းတယ် လို့ ထင်ကြတယ်။​ မိဘတိုင်းက သားသမီး ကို ယဉ်ကျေးလိမ်မာ တက်ခိုင်းပြီး မိဘ စကား ကို အတင်းနားထောင်ခိုင်းတယ် လို့ ခံစားရတယ်။​ လေးစားမှုဟာ အတင်းလုပ်ယူရတာ မဟုတ်ဘူး။​ သားသမီးတွေ က မိဘ ကို လေးစားဖို့…More