Software Engineering——A PRACTITIONER'S APPROACH (english edition · eighth edition)
CONTENTS AT A GLANCE
PART TWO MODELING
CHAPTER 10 Component-Level Design 276
10.2 DESIGNING CLASS-BASED COMPONENTS
The Open-Closed Principle (OCP). "A module[component] should be open for extension but closed for modification"
简单说明一下,按照软件过程,我们先进行需求分析。因为我们是做游戏开发商,所以需求来源于策划文档,所以我们直接对策划文档进行需求,建模在需求建模过程中,可以分析用例和类。然而困难是类方法的参数和返回值,而最近出了流程及界面,在进行前后端交互的接口定义上我和前端人员进行沟通。前端对接口的要求是界面上有什么参数在接口的返回值上就需要包括什么参数。作为后端,我对接口的要求是不是面向界面,而是面向与功能,也就是在建模时分析出的类操作。这样的话,那的参数就可以根据前端界面,以及游戏的玩法确定返回值只需要给出前端需要的动态数据。
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
?ARCHITETUAL DESIGN
Record at P261
Choosing the right architecture style can be tricky. Bushman suggests two complementary concepts that can provide some guidance.
Problem frames(wikipedia linked) describe characteristics of recurring problems, without being distracted by references to details of domain knowledge or programming solution implementations.
Supplement
The first problem frames identified by Jackson included:
- required behavior
- commanded behavior
- information display
- simple workpieces
- transformation
The intuitive idea behind this problem frame is:
- There is some part of the physical world whose behavior is to be controlled so that it satisfies certain conditions. The problem is to build a machine that will impose that control.
Domain-driven design suggests that the software design should reflect the domain and the domain logic of the business problem you want to solve with your application.