Separation of Concerns 关注点分离
Separation of concerns is a design principle for separating a computer program into distinct
sections, such that each section addresses a separate concern. For example the business logic of
the application is a concern and the user interface is another concern. Changing the user interface
should not require changes to business logic and vice versa.
将一个计算机程序分割成不同模块的程序,来分割一个程序的不同关注点,一个模块只关心一个点.例如应用程序中,业务逻辑属于一个点,用户接口属于另外一个点.而当你修改用户接口的时候,不用关心业务逻辑,反之亦然.这也正对应着,软件工程学中一直强调的高内聚低耦合的设计思想,属于一个功能点的内容要仅仅相扣在一起,而属于不同功能点的内容要分割开来,这样你修改一处的逻辑,而不用去担心另外一块的逻辑是否会受到影响.
Why
Simplify development and maintenance of software applications.
When concerns are well-separated, individual sections can be reused,
as well as developed and updated independently.
1.应用软件可以很轻松的进行升级和维护.
2.当关注点优雅的分割之后,模块与模块直接能够很好的被复用,同样模块内也能够很好的更新和扩展.