Homework1 Solution
Homework1 Solution
Homework1 Solution
• delete-member
• update-member-record
Object-oriented design
In the object-oriented design approach, the system is viewed as collection of
objects (i.e. entities). The state is decentralized among the objects and each
object manages its own state information. For example, in a Library Automation
Software, each library member may be a separate object with its own data and
functions to operate on these data. In fact, the functions defined for one object
cannot refer or change data of other objects. Objects have their own internal data
which define their state. Similar objects constitute a class. In other words, each
object is a member of some class. Classes may inherit features from super class.
Conceptually, objects communicate by message passing.
class detector
attributes:
status, location, neighbors
operations:
create, sense_status, get_location,
find_neighbors
class alarm
attributes:
location, status
operations:
create, ring_alarm, get_location,
reset_alarm