วิธีการออกแบบเพื่อลดการซับซ้อนของ software
ควรออกแบบให้เป็น Layer และ แต่ละ Layer ควรกำหนดจุดประสงค์ให้ชัดเจน

ภาพจากหนังสือ https://www.amazon.com/Grokking-Simplicity-software-functional-thinking/dp/1617296201
จากภาพด้านบนเราควรจะกำหนดวัตถุประสงค์ของแต่ละ layer ให้ชัดเจน และ call graph ก็ไม่ควรจะยุ่งเหยิง หรือมีลูกศรที่ข้าม layer และใน layer เดียวกันก็ไม่ควรจะมีที่เรียกกันเอง ( ถ้า function นั้นๆ เรียก function ใน layer เดียวกัน function นั้นก็ต้องอยู่บน layer ที่สูงกว่า )

Layer ที่อยู่ต่ำ คือ layer ที่เรียกใช้ function library ของภาษา หรือ system call ของ os ส่วน function ที่อยู่ชั้นบน คือ business domain layer ซึ่ง layer ที่อยู่ด้านบนถัดไปของ business domain layer ไม่สมควรที่จะรับรู้ data structure
Function ที่อยู่ layer บนมันจะเป็น function ที่มีการเปลี่ยนแปลงบ่อย มากกว่า function ที่อยู่ layer ต่ำกว่า
Function ที่อยู่ layer ด้านล่าง จะถูกใช้งานในหลายๆ function ที่อยู่ใน layer ที่สูงกว่า
Function ที่คุ้มค่าสำหรับ testing คือ function ที่อยุ่ใน layer ล่างๆ เพราะ เป็น function ที่ถูกเรียกใช้บ่อยจาก function ที่อยู่ใน layer ที่สูงกว่า
Get in Touch with us
Related Posts
- What Is an LMS? And Why You Should Pay Attention to Frappe LMS
- Agentic AI in Factories: Smarter, Faster, and More Autonomous Operations
- Smarter, Safer EV Fleets: Geo-Fencing and Real-Time Tracking for Electric Motorcycles
- How to Implement Google Single Sign-On (SSO) in FastAPI
- Build Your Own Taxi Booking App with Simplico: Scalable, Secure & Ready to Launch
- Building a Scalable EV Charging Backend — For Operators, Developers, and Innovators
- How to Handle Complex Pricing for Made-to-Order Products in Odoo
- How to Build a Made-to-Order Product System That Boosts Sales & Customer Satisfaction
- Transform Your Operations with Autonomous Agentic AI
- Streamline Fiber Tester Management with a Lightweight EXFO Admin Panel
- Enhancing Naval Mission Readiness with EMI Simulation: Cost-Effective Risk Reduction Using MEEP and Python
- Strengthen Your Cybersecurity Posture with Wazuh: A Scalable, Cost-Effective SIEM Solution
- OCPP Central System + Mobile App — Customer Proposal
- How TAK Systems Are Transforming Border Security
- ChatGPT-4o vs GPT-4.1 vs GPT-4.5: Which Model Is Best for You?
- Can Clients Decrypt Server Data Without the Private Key? (Spoiler: No—and Here’s Why)
- Managing JWT Authentication Across Multiple Frameworks
- Building a Lightweight EXFO Tester Admin Panel with FastAPI and Alpine.js
- Monitoring Cisco Network Devices with Wazuh: A Complete Guide
- Using FastAPI to Bridge Mobile Apps with OCPP EV Charging Systems