Question: A Real Estate Inc. problem has two classes. It includes ?House Seller? and ?House Buyer?. Here the class House Seller is taken to be processed
A Real Estate Inc. problem has two classes. It includes ?House Seller? and ?House Buyer?. Here the class House Seller is taken to be processed further.
Invariant in CRC card
Invariant is a type of constraint captured in object oriented language. Invariants are the contracts that must be true for each instance of the class. For example: the range of values for an attributed.
Invariants are generally attached with the class and specified in CRC cards and class diagrams as well through adding a set of the assertions within them. The below card shows the attributes with invariants.

For the real estate Inc:
A. Choose one of the classes and create a set of invariants for attributes and relationships and add them to the CRC card for the class.
B. Choose one of the methods in the class that you chose and create a contract and a method specification for it.
Use OCL to specify any pre- or post condition and use both structured English and an activity diagram to specify the algorithm.
Front Class Name: HouseId: 1 Seller Description: A type of person who wants to sell his houses. Responsibilities Distribute Information to Agents ( Back Attributes Name (1..1): String Contact (1.1): String Number of Houses (1..*): unsigned long House Numbers (1..*): array of int Prices of each (1..*): array of unsigned long Type of each house (1..*): array of string Relationships Generalization (A Kind Of): Aggregation (Part-of): House Buyer Type: Concrete, Domain Other Association: Collaborators House Buyer
Step by Step Solution
3.31 Rating (154 Votes )
There are 3 Steps involved in it
To tackle this problem we need to perform two main tasks defining invariants for the House Seller class and creating a method specification using OCL ... View full answer
Get step-by-step solutions from verified subject matter experts
