Published on

COMP2120 - Past Exam

Table of Contents

Past Exam

Question 1

---Business Data Diagrams, Domain Models and Design Class Diagrams look similar to each other because they call have boxes that represent "classes". However, the idea of a class is somewhat different in each of these three diagram types. Explain what the idea of a class is in each of these diagram types.---

Business Data Diagrams: Diagrams here usually represent basic concepts. There are usually only very few classes in a BDD as they should be short and to the point so that a client can easily understand what is being conveyed to them.

Domain Models: Classes here are more similar to Java like classes. These classes usually represent important computations as well as important data. Fragments here can be larger than in a BDD.

Design Class Diagrams: DCDs are meant to model actual code. DCD classes are meant to show or resemble real classes in an object oriented language. The connections in a DCD allow us to understand association links and any essential dependencies must be included in our code.

  • Dependencies refer to the direction of the association links.

Question 2

---The "application layer" of a layered software system is the layer that manages the operation of use cases. Imagine that a software engineer suggests that it could be useful to have classes that represent certain actors (important user types) in this layer. Describe the possible advantages of having such actor-classes in the application layer.---

As the application layer of a software system is the tier in which the business logic of the application runs, having access to such actor-classes would greatly benefit engineers. This is because the actor-classes would be able to directly interface or interact with the business logic of the application without having to first

Question 3

---When a user interacts with a user interface, they build up a mental model of the software that is cometimes called a "conceptual model". A Domain Model communicates a model to developers and stakeholders that is also sometimes called a "conceptual mode". Discuss the advantages and disadvantages that there might be in aligning these two types of conceptual models as closely as possible.---

A conceptual model in someones mind can be hugely beneficial in creating the Domain Model. This is because the classes in a DM are similar to the classes in Java or other OO languages. As such, having a good understanding of the underlying problem at hand before trying to implement it in the DM or in future aspects of the project allows for greater insight into the inner workings of the software. A disadvantage of aligning these two models is that one may become too 'involved' in the model, they may also try to pack too much detail or functionality into the final DM as they are going off a full conceptual model in their mind while constructing the DM. This may lead to confusion of the client as too much could be happening at once.

Question 4

---In software engineering, there are a number of important software design principles and a number of important software design patterns. Explain the general difference between a principle and a pattern for software design. Illustrate your answer by reference to one specific example of a design principle and one specific example of a design pattern.---

  • Principle: Software Design Principles are 'best practices' for people (software engineers) to follow. They allow for a largely scalable architecture approach. An example of a design principle is the Liscov Substitution Principle. This states that subclasses or any classes that are derived should be completely substitued of the superclass. This means that a subclass should enhance the functionality of a class, but should not reduce or hinder it.

  • Pattern: Design pattersn are set techniques that show/tell people how to design, architect and create code. Each design pattern has different use cases and no one design pattern fits all. As such you should find the appropriate pattern for the task at hand. An example of a design pattern is the Builder Pattern. This pattern allows you to create complex objects in a stepwise manner. Different types and/or representations of an object using the same construction code can be produced.

Question 6

---Describe the possible advantages and disadvantages of including class interfaces in a Domain Model.---

By including class interfaces in a Domain Model, you are directly limiting yourself by the binding contract created by each class interface. Each class interface could also be too low level for a Domain Model and would be better suited for a DCD. This is because the DCD deals with real code and the DM is meant to show the possible connections, computations and data that would be present in the system. You could include class interfaces in your DM however, if you wanted to be very specific about the possible connections, computations and data that would occur in the system. Real-time systems would benefit from such tight constraints as they too must adhere to the provided tight constraints.

Question 7

Question 8

Question 9

Question 10

Question 11

Question 12