Object design

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.

posted on 2008-01-06 23:41  融化了的朱古力  阅读(261)  评论(0)    收藏  举报

导航