Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

116 3.1 Explain the following Object Oriented design principles: 3.1.1 Coupling

ID: 3903528 • Letter: 1

Question

116 3.1 Explain the following Object Oriented design principles: 3.1.1 Coupling 3.12 Cohesion 3.1.3 Navigation visibility 3.2 Describe whole part relationships in relation to and demonstrate how they are represented in UML class diagrams. Questión 4 Consider the scenario of a car wash business and answer the questions that follow. (10) or the manager to effectively manage the scheduling of cars to be washed and to manage time effic iently, he has requested an IT company to develop a system that will make it possible for car owners to use a mobile app to book for the washing of their cars. When a booking is made the car owner will enter his/h her details including contact nurnbers, enter the vehicle details such as registration number, description, etc. and selected type of washing required. The system will determine and display the available time slcts so that the owner can select a suitable slot. The system als the car wash. The booking details including the amount te be paid are displayed so the owner can o checks the status of the car owner, car owners who are troublesome are barred from select a form of payment. The vehicle owner thet confivs the booking. The manager may select the manage bookings to cancel or reschedule bookings On the last day of the week the system generates reports for manager to view the number of cars washed by each wash bay employees. The system also allows for the accumulation of points every time a car is brought for washing. When a certain number of points is reached the system sends out an SMS to the owner inviting for a free car wash 4.1 List three and describe three types of events. For each even type give an example from the case study above. 4.2 Develop a state machine diagram showing states and transitions for the car object. When a booked car arrives at the car wash it is allocated to a washing bay which is manned by washing personnel and marked as such on the system. When washing is completed the car is then parked at the collection area and set as ready for collection on the system. The owner of the car is notified to make a payment and collect the car so it can be recorded as released from all the ba ys.

Explanation / Answer

3.1)Answer:

Coupling:

Coupling is the degree to which one class knows about another class. Let us consider two classes class A and class B. If class Aknows class B through its interface only i.e it interacts with class B through its API then class A and class B are said to be loosely coupled.

If on the other hand class A apart from interacting class B by means of its interface also interacts through the non-interface stuff of class B then they are said to be tightly coupled. Suppose the developer changes the class B‘s non-interface part i.e non API stuff then in case of loose coupling class A does not breakdown but tight coupling causes the class A to break.

So its always a good OO design principle to use loose coupling between the classes i.e all interactions between the objects in OO system should use the APIs. An aspect of good class and API design is that classes should be well encapsulated

Cohesion:

Cohesion is used to indicate the degree to which a class has a single, well-focused purpose. Coupling is all about how classes interact with each other, on the other hand cohesion focuses on how single class is designed. Higher the cohesiveness of the class, better is the OO design.

Benefits of Higher Cohesion:

Single Responsibility principle aims at creating highly cohesive classes

Navigation Visibility :

navigation visibility refers to the ability of one object to view and interact with another object, and is indicated by an arrow pointing to the visibleclass. We use two types of navigation visibility during design: attribute navigationvisibility and parameter navigation visibility.