วิธีการออกแบบเพื่อลดการซับซ้อนของ 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
- 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
- Simulating EMC/EMI Coupling on a Naval Top Deck Using MEEP and Python
- How the TAK System Works: A Complete Guide for Real-Time Situational Awareness
- Building an E-commerce Website & Mobile App with Smart AI Integration — The Modern Way
- Personalized Recommendations Are Here — Powered by Smart Analytics
- Rasa vs LangChain vs Rasa + LangChain: Which One is Right for Your Business Chatbot?
- Understanding Wazuh by Exploring the Open Source Projects Behind It
- How to Integrate App Authentication with an OCPP Central System
- Beginner’s Guide: How EV Charging Apps Communicate, Track Charging, and Calculate Costs
- Building an OCPP 1.6 Central System with Flask async, WebSockets, and MongoDB
- How AI Supercharges Accounting and Inventory in Odoo (with Dev Insights)
- Building a Fullstack E-commerce System with JavaScript
- Building Agentic AI with Python, Langchain, and Ollama for eCommerce & Factory Automation
- Diagnosing the Root Cause of P0420 with Python, OBD-II, and Live Sensor Data
- How to Apply The Mom Test to Validate Your Startup Idea the Right Way
- When to Choose Rasa vs Langchain for Building Chatbots
- Introducing OCR Document Manager: Extract Text from Documents with Ease
- Testing an AI Tool That Finds Winning Products Before They Trend — Interested?