Skip to content

Design Pattern

SWE · Final · Spring 25

This browser can’t show the PDF here

Open it, and your phone’s PDF viewer takes it, or download it.

Read the questions as text

Read off the PDF by AI, so it may have mistakes. The PDF is the original.

Daffodil International University Faculty of Science & Information Technology Department of Software Engineering Final Examination, Spring 2025 Course Code: SE 311; Course Title: Design Pattern Sections & Teachers: AD(40-A,B,C,D,I) & SD(40-E,F,G,H) Time: 2 Hours Marks: 40 Answer ALL Questions [The figures in the right margin indicate the full marks and corresponding course outcomes. All portions of each question must be answered sequentially.] 1. a) You are tasked with designing a Smart Classroom Automation System for Daffodil International University. The system has the following subsystems: Lighting System - turnOn(): Turns on the lights & turnOff(): Turns off the lights. Temperature Control System - turnOnAC(): Turns on the AC & turnOffAC(): Turns off the AC Projector System - turnOnProjector(): Turns on the projector & turnOffProjector(): Turns off the projector. Apply your knowledge to identify the appropriate design pattern for this scenario and implement the code that follows the pattern. [Marks-6] [CLO-2, Level-3] b) Illustrate the Class Diagram for the above scenario with proper explanation. [Marks-4] 2. a) You are developing a Notification System for a mobile app. The app should send notifications to users in different formats based on their preferences. The possible notification formats are: Email Notification, SMS Notification and Push Notification. The system should allow the user to choose the type of notification they want to receive (email, SMS, or push). When a new notification is required, the system should create the appropriate notification object based on the user's choice. Apply your knowledge to identify the appropriate design pattern for this scenario and implement the code that follows the pattern. [Marks-7] [CLO-3, Level-3] b) Illustrate the Class Diagram for the above scenario with proper explanation. [Marks-4] c) Currently, the NotificationService class directly depends on the concrete notification types like EmailNotification, SMSNotification, and PushNotification. Now, you want to add a new notification type (e.g., Voice Notification) to the system. Determine the principle(s) that are being violated here and how will you solve this? [Marks-4] 3. a) In the BLC (Blended Learning Center), students are enrolled in various online courses. Whenever a new announcement or update is made in the course, all enrolled students need to be notified about it, such as new lecture videos, assignments, or exam schedules. The system allows students to subscribe to course updates and automatically receive notifications when an update is available. Whenever the course instructor posts an announcement, the Course notifies all the subscribed Students with the details of the new update. Create the UML diagram for the pattern based on the above scenario. [Marks-5] [CLO-4, Level-6] b) Imagine you, Tom, are shopping on a website where you want to buy a Mouse and a Keyboard. When you search for the Mouse, it's available on the website, and you are able to see all its details (price, features, etc.). However, when you search for the Keyboard, the website shows that it is out of stock, and thus you cannot see any details about it. Explain how the MVC architecture would work in each case, showing the architecture diagram. [Marks-5] c) You are developing an E-Commerce Order System for an online store. The system has a class called OrderProcessor, which handles: createOrder(), processPayment() and manageShipment(). As the system grows, OrderProcessor becomes more complex. For example, adding a new payment method or modifying shipment logic requires changes to the entire class, making it harder to maintain and extend. Additionally, when you try to create OnlineOrderProcessor and InStoreOrderProcessor subclasses, the logic for payment and shipment differs. This causes unexpected behavior when switching between these subclasses, violating expected behavior. Specify which SOLID principles are violated in this scenario and how would you solve this problem? [Marks-5]