惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
M
MIT News - Artificial intelligence
罗磊的独立博客
博客园 - 【当耐特】
A
About on SuperTechFans
Last Week in AI
Last Week in AI
雷峰网
雷峰网
IT之家
IT之家
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
博客园 - 叶小钗
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
The Cloudflare Blog
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
S
SegmentFault 最新的问题
Recent Announcements
Recent Announcements

博客园 - 融化了的朱古力

AJAX Automated Testing Professional asp.net 2.0 server control and component development Online dictionary ASP.NET 2.0服务器控件与组件开发高级编程 Professional asp.net 2.0 Server Control and Component Development .NET组件程序设计 .NET组件程序设计0723 .NET组件程序设计0721 .NET组件程序设计 never draw to an inside straight Per say Agile Principles, Patterns, and Practices in C# MapControl MapPoint Helpful Links 20060827 20060812 what is locality of reference? 20060806 20060802
Object design
融化了的朱古力 · 2008-01-06 · via 博客园 - 融化了的朱古力

Like many human endeavors, design is part art, part engineering, part guesswork, and part experimentation.Discipline, hard work, inspiration, and sound technique all play their part as well.

Objects are not just simple bundles of logic and data. They are responsible members of an object community.Design is the process of making your dreams come true.

An application = a set of interacting objects
An object = an implementation of one or more roles
A role = a set of related responsibilities
A responsibility = an obligation to perform a task or know information
A collaboration = an interaction of objects or roles (or both)
A contract = an agreement outlining the terms of a collabor

A role is a set of responsibilities that can be used interchangeably.

We have been speaking of objects and roles loosely. What is the real difference? When a role is always played by the same kind of object, the two are equivalent. But if more than one kind of object can fulfill the same responsibilities within the community, a role becomes a set of responsibilities that can be fulfilled in different ways. A role is a slot in the software machinery to be filled with an appropriate object as the program runs.An object embodies a set of roles with a designated set of responsibilities.