Advanced Software Analysis and Design

Laboratory 4 Design PrinciplesLaboratory 4 Design PrinciplesFall 2017LAB 4. Design Principles4.1 GoalsAfter watching the assigned lectures and performing the exercises given below, the student should be able to:1. Analyze basic class level design for violations of 5 major design principles2. Redesign the classes so that they do not violate major design princples or minimize the violations through documented design tradeoffs4.2 ExercisesAnalyze each of the following class diagrams and1. Determine which, if any, of the five software design principles (srp, ocp, Liskov, dip, or isp) have been violated (the answer may be none, one, or more than one).2. Redesign the class diagrams in such a way as to fix the identified violations without introducing any new problems.Write a paragraph for each answer (1 and 2) above and include a new class diagram as part of your answer to answer 2. Make sure you thoroughly describe which principle has been violated and why. Also discuss how your solution in answer 2 solves the problem. You may run into a situation where you have conflicts between principles. If that happens, explain why you chose your solution and make sure you document your design decision related to the various principles.4.2.1 ViewerThis is a typical 3-layer system, with a viewing layer, a data layer, and a database layer. All method calls are made from the upper layers to the lower layers (e.g., viewer to data, data to database).4.2.2 AutomobileHere we have a simple Automobile class with a set of associated methods. Each Automobile has up to four tires, which can be changed by the Automobile class.Automobile -oil: int +start() 0..4 Tire+stop() +changeTire(Tire[1..4]) +drive() +wash() +checkOil() +getOil(): int 4.2.3 Graphical EditorIn this example, assume the GraphicEditor package has an attribute “s” that points to a Shape. “s.type” determines the type of the Shape object. The drawShape method chooses the appropriate type given the value of “s” and draws that shape.4.2.4 3D Game BoardWe would like to use a 2D board used in an online board game simulator to build a 3D board, which has been done by adding a third dimension to the original Board and adding appropriate methods for the 3D board.4.3 CompletionYou should turn in:1. Answers to questions 1 and 2 from 5.2 for each of the four exercises Sections 5.2.1 – Make sure your answers include not only the answer, but why you chose those answers/solutions.================