BEST代写-线上编程学术专家

Best代写-最专业靠谱代写IT | CS | 留学生作业 | 编程代写Java | Python |C/C++ | PHP | Matlab | Assignment Project Homework代写

软件工程代写|SYSC 3020 – Introduction to Software Engineering Fall 2022

软件工程代写|SYSC 3020 – Introduction to Software Engineering Fall 2022

这是一篇来自加拿大的软件工程代写

 

Assignment 3

Submission instructions

Upload a single PDF file with your answers to the following questions. The file should be named: lastName_firstName_ID_A3.pdf

You can submit multiple times, only the last submission is considered.

This assignment should be completed individually.

Question 1 [5 marks]

Using the example of the Trip Planning Software discussed in class (see sec 6.4.1 in the textbook), suppose that the PlanningService class needs to sort trips

using one of the following algorithms: bubble sort, heap sort, or quick sort. The selection of an algorithm will depend on the context in which the collection of trips is used: sometimes a bubble sort should be used, sometimes a heap sort,etc.

  1. Which design pattern would you use to allow for the selection of any of these sorting algorithms at run time, and for the possibility of adding new such algorithms in future releases?
  1. Once you have selected an appropriate design pattern, justify your choice by listing the needs of the problem that correspond to the intent of the pattern.
  1. Show in a class diagram how the use of the pattern would look like.

Question 2 [5 marks]

You are creating an application that needs functionality for logging. You need to implement a logger and the log information (logging of actions, user who performs the action, and time of action) into a file. Log requests will come from different sources and need to be written to the file.

  1. Which design pattern will allow you to handle this situation? B. Once you have selected an appropriate design pattern, justify your choice by showing what needs of the problem correspond to the intent of the pattern.
  1. Illustrate in a class diagram what the use of the pattern would look like.

Question 3 [5 marks]

The class diagram below illustrates a problematic situation where client classes have too many relationships with subsystem’s classes.

Question 4 [5 marks]

Suppose you’re developing a genealogy system, in which you have to model various human relationships. The class diagram below is from this system. Notes:

– A person may have multiple marriages, and also children with several different partners over the course of his or their life.

– The association class Union represents the husband–wife association.

  1. Describe how the following operations of class Person would be performed.

(You do not need to write code; simply describe how the available information would be used to compute the result.)

A.1. getSiblings

A.2. getStepSiblings

A.3. getNumberOfMarriages

  1. Write OCL constraints expressing the following facts about the class diagram above.

B.1. You cannot die before you are born.

B.2. The date of a marriage always precedes the date of that marriage’s

divorce.

bestdaixie

评论已关闭。