Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
CS521 - Midterm Exam
First Name Important Notes: There are 3 questions in the exam paper Type your answers (NO hand-writing) below every question, and please make sure you distribute your time wisely to cover all questions. The exam is an individual-work NOT team-work. Please do NOT communicate the exam content in any shape or form to anyone except myself or the TA Your midterm exam is due on Blackboard as a SINGLE PDF document by 11:59pm on Wednesday 6/22/16. Q1. (15 points). (Provide short answers for the following question; a paragraph 5 to 10 lines) 1. The intelligent object-oriented design has to be reusable, flexible, and extensible. Explain. Intelligent design must be designed to super type. Example: This leads to modular design where complex structure is broken down into simpler and manageable units called modules. Modular design is necessary for reusable, extensible and flexible models. Hence we can infer the intelligent object-oriented design is reusable, flexible and extensible. Reusable: If the design is reusable, we reuse design so that you don’t have to test it again. For example, if we are given a choice to design from scratch or use a design which is tested and used, it would any day be better to use a design which is tested and proven to be correct rather than building from scratch. This saves time and increases performance. Flexible: Flexibility provides design with the room to grow, to cater for requirement changes during development and for additional requirements that the users will want in future. Hence, design models have to be flexible. Putting the right amount of flexibility into the design is an important part of the act of designing. Extensible: Extensibility requires the unit of code to not be fragile with respect to changes in the entities with which it interacts: it must neither break when units of code are added or replaced, nor when the data that it manipulates is moved. Hence, a good design model has to be extensible in order to accommodate changes without effecting the existing model. 2. Explain the difference between Requirement Analysis and Requirement Specifications. Requirement specification is the invention and definition of the behavior of a new system (solution domain) such that it will produce the required effects in the problem domain. We come up with the problem in requirement specification. We start from a knowledge of the problem domain and the required effects determined by elicitation and analysis and come up with the specification document. Requirement analysis is the understanding of the problem. Our goal during requirements analysis is to understand “what” the customer “needs” us to build. We build a model of the application and validate that our model will actually meet the customer’s needs. The process of studying and analyzing the customer and the user needs to arrive at a definition of the problem domain and system requirements is called requirement analysis. 3. Software is composed of two primary elements: structure and behavior, name at least one UML notation that could be used to capture each element. Structure diagrams are not utilizing time related concepts, do not show the details of dynamic behavior. Class diagram is a static structure diagram which describes structure of a system at the level of classifiers (classes, interfaces, etc.). It shows some classifiers of the system, subsystem or component, different relationships between classifiers, their attributes and operations, constraints. Other structure diagrams include object diagram, package diagram, Model diagram etc. Ex: AccountSpecialist -accountSpecialistName : string -accountSpecialistID : int -address : string -email : string -phoneNo : int +createCustomerAcct() +editCustomerAcct() +createIncidentTicket() +placesOrderPPV() Technician -TechSupportID : int -TechSupportName : string -address : string -email : string -phoneNo : int +getIncident() +scheduleIncidentTicket() +cancelIncidentTicket +closeIncidentTicket() RentGamesOnline -GameID : int -GameName : string -Type : string InternetPlan -PlanID : int -PlanName : string -PlanType : string PPVEvents -EventID : int -EventType : string -EventName : string +getEventType() +getEventName() PPVLiveSports -EventID : int -EventName : string -EventType : string TV plan -PlanID : int -PlanName : string +getHDBox() Manager -managerID : string -managerName : string -address : string -email : string -phoneNo : int +login() +cancelOrder() +updateOrder() +deleteOrder() Orders -OrderID : int -CustomerID : int +getOrderDetails() +getOrderProducts() Product -ProductID -ProductName -ProductType +displayProducts() CustomerAccountInfo -firstName : string -lastName : string -email : string -Address1 : string -Address2 : string -phone : int -city : string -state : string -zipcode : string +getAccountDetails() PayMonthlyBill -CustomerID : int -TotalAmount : int -CardNo : int +makePayment() HighDefinitionBox needs has PPVMovies -EventID : int -EventType : string -EventName : string 1..* 1..* 0..* edits -BoxID : int -BoxName : string updates Assigns 1..* n Has Privileges Places n n 0..* 1..* 1..* creates 0..* 0..* Customer -customerID : int -customerName : string -address : string -email : string -phoneNo : int +login() +payMonthlyBill() +getOrders() +updateRecord() Behavior diagrams show the dynamic behavior of the objects in a system, which can be described as a series of changes to the system over time Sequence diagram is the most common kind of interaction diagrams, which focuses on the message interchange between lifelines (objects). Other Behavior diagrams include use case diagram, activity diagram, timing diagram etc. Ex: :Ticket:AccountSpecialist Technician:Schedule CreateIncidentTicket() [Created] AssignIncidentTicket() [Assigned] ScheduleIncidentTicket() CloseIncidentTicket() CancelIncidentTicket() [TicketScheduled] [TIcketClosed] [TIcketCancelled] loop For each of the incident ticket created 4. Which mechanism you should favor to use in producing your design: Inheritance or Composition? Is a relationship between extensibility and inheritance? Is a relationship between flexibility and composition? Explain. Favor object composition over class inheritance. It gives design higher flexibility. In other words, HAS-A can be better than an IS-A relationship. Initial design is simplified by identifying system object behaviors in separate interfaces instead of creating a hierarchical relationship to distribute behaviors among business-domain classes via inheritance. This approach more easily accommodates future requirements changes that would otherwise require a complete restructuring of business-domain classes in the inheritance model. Additionally, it avoids problems often associated with relatively minor changes to an inheritance- based model that includes several generations of classes Extensibility is inheritance where in you can add new requirements as an extension to the existing model. Flexibility is extensibility. Flexibility is when you can make changes to the existing system without effecting it. Hence composition provides this facility and leads to flexibility of the design. 5. Explain the difference between the Observer design pattern and MVC architectural pattern. Observer Design Pattern: Observer pattern is used when there is one-to-many relationship between objects such as, if one object is modified, its dependent objects are to be notified automatically. Observer pattern falls under behavioral pattern category. Intent: Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. Encapsulate the core (or common or engine) components in a Subject abstraction, and the variable (or optional or user interface) components in an Observer hierarchy. The "View" part of Model-View-Controller. Observer pattern uses three actor classes. Subject, Observer and Client. Subject is an object having methods to attach and detach observers to a client object. We have created an abstract class Observer and a concrete class Subject that is extending class Observer. Model-View-Controller: Intent: Model–view–controller (MVC) is a software architectural pattern for implementing user interfaces on computers. It divides a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented to or accepted from the user. The central component of MVC, the model, captures the behavior of the application in terms of its problem domain, independent of the user interface. The model directly manages the data, logic and rules of the application. A view can be any output representation of information, such as a chart or a diagram. Multiple views of the same information are possible, such as a bar chart for management and a tabular view for accountants. The third part, the controller, accepts input and converts it to commands for the model or view. Q2. (35 points) A retailer sells software games, accessories, devices, and consoles for a number of gaming platforms: Xbox, Wii, and PlayStation. The games have three rating categories: EveryOne, Teen, and Mature. The retailer would like you to build an object-oriented application that will meet the following requirements: High-Level Requirements: Consider the following high-level description for the retailer: The intent is to build an application that will allow customer to buy/trade-in products from the retailer either in-store or online The store has a StoreManager, Customers, and Salesmen The retailers sells new and pre-owned different game consoles, games, and tablets The StoreManager can Add/Delete/Update products Salesman can create Customer accounts There are 3 Console Manufacturers and each offers its own models: 1. Microsoft 1. XBOX One 2. XBOX 360 2. Sony 1. PS3 2. PS4 3. Nintendo 1. Wii 2. WiiU There are 3 Game Makers 1. Electronic Arts 2. Activision 3. Take-Two Interactive Every console might have accessories that could be bought separately Retailer offers warranty that can be purchased by the customer for every console The customer can pre-order products The customer can trade-in products The customer can place an order online, check the status of the order, or cancel the order. The customer can pay in cash, check, or credit card The customer has the choice to enroll (or cancel) and become Power Member in order to receive 5% discount for every item purchased for an annual fee of $100 Some of the products may have store special-discounts Some of the products may have manufacturer rebates The customer can choose one of the following options when buying a new console 1. Buy the new console with no replacement 2. Buy the new console with 1 year replacement for 50% fee of the console retail price; under this plan the customer can replace the console by a new one any time during the year (The console can be replaced only once for the customer). 3. Buy the new console with lifetime replacement for 65% fee of the console retail price; under this plan the customer can replace the console by another new one any time (The console can be replaced only once for the customer). The customer can rent a console. However, there are a number of lease plans that the store like to offer its customers 1. Daily rental (for example renting the console for 2 days) 2. Monthly rental (for example rent the XBOX ONE console for 2 months with rental $20/month) 3. Yearly rental (for example rent the XBOX ONE console for $100/year) Provide your answers for the following: 1. Domain Dictionary 2. Analysis Class Diagram 3. Design Class Diagram 4. Object Data Model Domain Dictionary: Name Type Description Store Manager Role The store manager Adds, deletes and updates products. Add Product Process The process of adding new product. Performed by Store Manager. Delete Product Process The sequence involved in deleting a product. Performed by Store Manager Update Product Process The process of updating the product. Performed by the Store Manager Product Object The product which is added, deleted or updated. Choose Gaming Platform Process The process choosing one of the platforms: Xbox, Wii, and PlayStation. Store Management Function Act of adding, deleting, and updating a product by the store Manager. Platform Object The platform chosen as a result of choose gaming platform. Choose Rating Category Process The process of choosing rating category: Everyone, Teen, and Mature. Category Object The category chosen as a result of the choose rating category process. Customer Role Buys/trades-in products from the retailer either in-store or online. Salesmen Role Creates customer account. Create customer account Process The process involved in order to create an account for the customer. Performed by the Salesmen. Account Object The account number associated with a particular customer. Retailer Role Retailer sells software games, accessories, devices, and consoles for a number of gaming platforms. Retailer Management Function The act of selling new and pre- owned different game consoles, games, and tablets by the retailer Sell Products Process The process of selling various products. Performed by the Retailer. Offer Warranty Process Retailer offers warranty that can be purchased by the customer for every console. warranty Object The warranty period offered by the retailer. Pre order products Process The process of pre-ordering the products. Performed by the Customer. Order Object The order number associated with product. Trade in products Process The process of trading in products. Performed by the Customer Place order online Process The process of placing an order online. Performed by the Customer Check Order Status Process Sequence of actions involved in Checking the order status. Performed by the Customer. Status Object The status of the order. Cancel Order Process The process of cancelling the order. Performed by the Customer. Bill Payment Process The actions involved in making bill payment. Performed by the Customer Payment Receipt Object The receipt associated with the bill payment. Enroll for Power member Process Enrolling the customer as power member. Enrollment Object The enrollment ID associated with the power member. Cancel enrollment Process The process of cancelling the enrollment. Apply Store Special Discounts Process The process of applying the discount associated with the store. Discounted price Object The price after applying the discount. Apply manufacturer rebate Process Applying the manufacturer rebate Buy new console Process Sequence of steps involved in buying new console. Performed by the customer Apply replacement period Process Process of applying replacement period. Performed by the customer. Replacement Object The replacement period chosen as a result of apply replacement period process. Rent console Process The process of renting console. Performed by the customer. Rent Object The rented console associated as a result of rent console process. Apply rental Plan duration Process The process of choosing rental plan duration. Duration Object The duration associated with the plan as a result of applying rental plan duration.