Lecture27 - Q1 In the following table match the name of Design Pattern with its description Design Pattern name Description Strategy A method that

Lecture27 - Q1 In the following table match the name of...

This preview shows page 1 - 5 out of 15 pages.

1 Q1. In the following table, match the name of Design Pattern with its description. Design Pattern name Description Strategy A method that manufactures objects of a particular type. Singleton Define a one‐to‐many dependency between objects so that when an object changes state, all of its dependents are notified and updated automatically. Factory Allow an algorithm to vary independently from the clients using it. Composite Only one object of a Class should exist. Observer The ability to treat a whole and each of its parts and subparts in a uniform way. Q2. (True/ False) Black-box tests can be used to find aliasing errors that occur when two different formal parameters of a method both refer to the same object. Q3. ( True /false) One can use the Strategy design pattern to encapsulate an algorithm as an object.
Image of page 1
2 Q4 What is the first phase of the software life cycle? a. Testing b. Coding c. Design d. Specification Q5. What is the importance of building a system with low coupling? Q6. Design Pattern recognition Consider the following UML diagram. (a) First, identify the pattern in the diagram. (b) Second, identify the participants in the diagram and indicate their responsibilities.
Image of page 2
3 Q7. Given the following Java code, draw its UML class diagram. Provide as many details as possible public class Plane { public Propeller[] myPropellers; public Engine myEngine; } public class Propeller { public double thrust; public int mileage; } public class Engine { public double power; public int mileage; } public class Pilot { public int flightHours; public void fly(Plane p) { ... } } public class FighterPilot extends Pilot { public int rank; }
Image of page 3
4 Q8. Recording companies consider band and musician to be type of artist. A band consists of two or more musicians. Each song has an artist who wrote it. An artist can write a number of songs but each song is written by exactly one artist.
Image of page 4
Image of page 5

You've reached the end of your free preview.

Want to read all 15 pages?

  • Fall '15
  • OLIVIADAS
  • Design pattern, UML Class Diagram, max M

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture