全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Design pattern, strategy pattern, observer pattern, adapter pattern, model–view–controller?

又称: design pattern · strategy pattern · observer pattern · adapter pattern · model--view--controller

Definition 30.4 University Computer Science — Year 3 · 第 30 章 — Software Engineering: Design, Testing and Maintenance

A design pattern is a named, reusable solution to a design problem that recurs in a context, described by its problem, its structure and its consequences. The strategy pattern puts each variant of an algorithm behind one interface, so that the variant can be chosen at run time. The observer pattern lets objects register with a subject, which notifies each of them of its changes without knowing what they are. The adapter pattern wraps an object so that it offers the interface that a client expects. Model–view–controller (MVC) divides an interactive program into the model, which holds the data and the rules, the view, which presents them, and the controller, which turns the user’s input into operations on the model.

在原文中阅读 →