CSC/ECE 517 Fall 2009/wiki3 10 pz: Difference between revisions
No edit summary |
No edit summary |
||
Line 39: | Line 39: | ||
===Introduction=== | ===Introduction=== | ||
'''Object Think''' is first introduced by Peter Coad and Jill Nicola in the book “Object-oriented Programming” published in 1993. It is an approach to Object-oriented Programming that is based on the practice of object personification. Object Think requires developers to adopt a radically different way of thinking and tends to result in fewer objects and its primary objective is an accurate domain model made of composable objects that communicate with each other. | '''Object Think''' is first introduced by Peter Coad and Jill Nicola in the book “Object-oriented Programming” published in 1993. It is an approach to Object-oriented Programming that is based on the practice of object personification. Object Think requires developers to adopt a radically different way of thinking and tends to result in fewer objects and its primary objective is an accurate domain model made of composable objects that communicate with each other. | ||
An object is an entity with state and behavior. For example, a counter has a state (for example, the value is 2) and behavior (it can be incremented or decremented). The state is also referred to as attributes or fields, and the behavior is also referred to as methods or functions. A class is a template for creating objects. Here's a simple mnemonic: A + B = C, or attributes + behaviors = classes. | |||
It is important to begin believing objects in a computer systems are like us: they know things and know how to do things. We need to have faith in them, to rely on them, to trust them. For example, let us consider a button appears on a window in a GUI. The window knows “my title and height and width”, “what button is attached to me”, “how to move and resize” and “how to open and close”. The button knows “what my label says”, “what window I am attached to”, “my location on the window” and “how to be closed”. | |||
Traditional developers coding and formulating solutions tend to think like machines. This is known as formalism and has philosophical roots in the 18th century (The Age of Reason) which is also described as rationalism, determinism, or mechanism. So, western thought was strongly influenced by formalism, such as “CRC Card is good” and “Object Think is good”. | |||
Object Think developers think like objects when coding and formulating solutions. This is based in a school of thought known as hermeneutics, which is literally the study of interpretation. Hermeneutic philosophy is based largely on linguistics and semantic theory but extends beyond that to include theory of self-organized and evolutionary systems. | |||
==Comparison of CRC Card and Object Think== | ==Comparison of CRC Card and Object Think== |
Revision as of 20:03, 18 November 2009
CRC Card
Introduction
CRC (Class-Responsibility-Collaborator) Card is a simple yet powerful object-oriented analysis technique served as a brainstorming tool. Kent Beck and Ward Cunningham first introduced CRC cards at OOPSLA 1989 in their paper “A Laboratory for Teaching Object-Oriented Thinking”. The original purpose of CRC Card was to teach the object-oriented programming at Tektronix.
The CRC Card is composed of three components: Class; Responsibity; Collaborator.
Class
A Class represents a collection of similar objects. Objects are things of interest in the system being modeled. They can be a person, place, thing, or any other concept important to the system at hand. The Class name appears across the top of the CRC card.
Responsibility
A Responsibility is anything that the class knows or does. These responsibilities are things that the class has knowledge about itself, or things the class can do with the knowledge it has.
Collaborator
A Collaborator is another class that is used to get information for, or perform actions for the class at hand. It often works with a particular class to complete a step (or steps) in a scenario. The Collaborators of a class appear along the right side of the CRC card.
Examples
Here is a simple example of CRC Card to illustrate the concept of CRC Card.
Now, we consider a floor plan of a house. The floor plan is an overview of the house, it has several properties, such as the name of the floor plan, the plan positioning, the locations of all kinds of stuff. Before moved in, the house only contains some basic elements: door, window, wall, roof, security camera. The floor plan should collaborates with all of these elements, and all of these elements have their only property design, such as the style of door, the color of walls, the shape of roof, the brand and resolution of security camera, etc. However, the positioning of these elements should be defined in the floor plan. So, there are many properties in floor plan and it also has to collaborate with other elements. To illustrate the above relationships, we could use CRC Card, the sample of this simple example is posted aside.
Here is a complicated example of CRC Card to further illustrate the concept of CRC Card.
Object Think
Introduction
Object Think is first introduced by Peter Coad and Jill Nicola in the book “Object-oriented Programming” published in 1993. It is an approach to Object-oriented Programming that is based on the practice of object personification. Object Think requires developers to adopt a radically different way of thinking and tends to result in fewer objects and its primary objective is an accurate domain model made of composable objects that communicate with each other.
An object is an entity with state and behavior. For example, a counter has a state (for example, the value is 2) and behavior (it can be incremented or decremented). The state is also referred to as attributes or fields, and the behavior is also referred to as methods or functions. A class is a template for creating objects. Here's a simple mnemonic: A + B = C, or attributes + behaviors = classes.
It is important to begin believing objects in a computer systems are like us: they know things and know how to do things. We need to have faith in them, to rely on them, to trust them. For example, let us consider a button appears on a window in a GUI. The window knows “my title and height and width”, “what button is attached to me”, “how to move and resize” and “how to open and close”. The button knows “what my label says”, “what window I am attached to”, “my location on the window” and “how to be closed”.
Traditional developers coding and formulating solutions tend to think like machines. This is known as formalism and has philosophical roots in the 18th century (The Age of Reason) which is also described as rationalism, determinism, or mechanism. So, western thought was strongly influenced by formalism, such as “CRC Card is good” and “Object Think is good”.
Object Think developers think like objects when coding and formulating solutions. This is based in a school of thought known as hermeneutics, which is literally the study of interpretation. Hermeneutic philosophy is based largely on linguistics and semantic theory but extends beyond that to include theory of self-organized and evolutionary systems.