Professional Documents
Culture Documents
ADI December 2014 Marking Scheme - FINAL
ADI December 2014 Marking Scheme - FINAL
10 November 2014
Marking Scheme
This marking scheme has been prepared as a guide only to markers. This is not a set of
model answers, or the exclusive answers to the questions, and there will frequently be
alternative responses which will provide a valid answer. Markers are advised that, unless a
question specifies that an answer be provided in a particular form, then an answer that is
correct (factually or in practical terms) must be given the available marks.
If there is doubt as to the correctness of an answer, the relevant NCC Education materials
should be the first authority.
Where markers award half marks in any part of a question, they should ensure that
the total mark recorded for the question is rounded up to a whole mark.
Answer ALL questions
Marks
Question 1
Outline the FIVE (5) stages of the Object Oriented Analysis and Design (OOAD) 10
process and identify the main documentation used at each stage in the process.
The maximum number of marks for this question is 10. Award up to 2 marks for
each bullet point.
Identify the needs of users (1 mark). Documented via use case diagrams
(1 mark).
Identify the steps needed for each of the requirements (1 mark).
Documented via activity diagrams (1 mark).
Decompose the requirements for the system (1 mark). Documented via
class diagrams (1 mark)
Define the interactions between components (1 mark). Documented via
sequence diagrams (1 mark) and component diagrams (1 mark|)
Iterate over the process (1 mark).
Total: 10 Marks
Question 2
Write the program code for the following Class Diagram. This should include variable 10
declarations and method stubs. The code should include the appropriate data types
and access types for the variables, and the appropriate access types, parameter list
and return types for the methods.
Page 2 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
public class Pet {
private String name;
private int age;
private double weight;
private String species;
Award 1 mark for correct data types for all variables. 1 mark for correct access
types for all variables. 1 mark for correct parameter list for constructor method. 1
mark for no return type for constructor method, 1 mark for constructor method
having the same name as the class. 1 mark for initialising variables using
parameters passed into constructor method. 1 mark for correct access types for all
accessor and mutator methods. 1 mark for correct return types for all accessor and
mutator methods. 1 mark for correct parameter list (empty) for accessor methods. 1
mark for correct parameter list (one variable of the same data type as that of the
variable being altered) for mutator methods.
Total: 10 Marks
Page 3 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 3
Identifying classes, and which attributes and operations should belong to which 10
classes, can be carried out using Natural Language Analysis (NLA). From the
following scenario, use NLA to create an initial class diagram:
We are a large vehicle retailer and we need a system that allows us to manage our
inventory. We sell a range of cars, vans and motorcycles. For all types of vehicle, we
need to store details of the Vehicle Identification Number (VIN), manufacturer, model,
engine size, mileage and price. For cars, we also need to store details of the number
of doors (3 or 5 door) and style (hatchback, estate, or sedan). For vans, we need to
store the cubic capacity and height in centimetres. For motorcycles we need to store
the type (off road, on road, or hybrid) and number of wheels (2 or 3). For mini-vans,
we need to store the number of passengers it can carry (between 7 and 15).
Note: The above is one possible solution: some data types and exact names of
attributes and methods may vary. The inheritance between Vehicles and Cars
and MiniVans may also be modelled differently (e.g. with a common parent as
they share an attribute numDoors). Marks can be assigned more flexibly than
suggested above as long as the placement of attributes and methods is
appropriate to the different relationship structure.
Total: 10 Marks
Page 4 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 4
Anderson Gibbs and Co is a letting agency which specialises in letting luxury flats in
the North East of Scotland to corporate clients on a short term basis. Landlords
supply details to the agency about the properties they have available. Corporate
clients supply details about the type of properties they are seeking and what they are
willing to pay. Letting Agents can receive these details from landlords and clients,
schedule viewings for properties, and update the status of properties (e.g. from let/
occupied to vacant/ available). Letting agents also schedule quarterly inspections, in
which clients must attend. Corporate clients can view properties and pay rent.
Landlords can receive rent payments.
Award 1 mark for each correct use case (up to a maximum of 6 marks), 1 mark
for each correct actor (up to a maximum of 3 marks), and 1 mark for getting the
right relationships between actors and use cases.
Note: Other names for use cases are acceptable, the diagram shown is an
example solution rather than the only possible solution.
Total: 10 Marks
Page 5 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 5
a) One of the benefits of Object Oriented Design is the ability to use polymorphism. 2
Define the term ‘polymorphism’.
b) Describe the creational design pattern and briefly explain why creational design 4
patterns are useful in situations involving polymorphism.
Creational design patterns are used to handle the creation of objects: they
abstract the mechanism of this away from the developer (1 mark) meaning
that the developer never has to instantiate an object directly (1 mark).
Often, a developer will not know exactly what type of object they want – for
example in a drawing application where the user can select from a variety
of possible shapes so you don’t know which shape subclass to create (1
mark – also award this mark for any other suitable example or explanation).
Use of polymorphism by the pattern enables the creation of whichever
subclass is required, at runtime (1 mark).
c) The strategy design pattern is one of the structural design patterns. Describe how 4
this pattern works and state ONE (1) advantage and ONE (1) disadvantage of
using this pattern.
Total: 10 Marks
Page 6 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 6
a) Briefly explain what is meant by the term coupling and explain why it can cause 2
problems.
b) Coupling is necessary for classes to communicate with each other. However, the 8
choice of coupling has a big impact on the ease of adding functionality, changing
existing functionality, or removing functionality. Given this, identify and briefly
describe FOUR (4) types of coupling. Rank these FOUR (4) types of coupling
from most to least preferable with regards to how easily they allow changes to be
made in a program.
Total: 10 Marks
Page 7 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 7
b) System measures can be assessed using test driven development. Describe this 6
process.
Test driven development works by writing the tests before you write the
code (1 mark) and automating the running of those tests (1 mark).
Whenever you make a change to a piece of code, you run all the automated
tests (1 mark). This ensures the new functionality you are developing does
not break the existing functionality (1 mark). If the new functionality does
cause problems then you refactor to resolve issues (1 mark) and repeat the
process (1 mark).
Total: 10 Marks
Page 8 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 8
a) Consider the code below, and rewrite the code to demonstrate TWO (2) ways in 4
which it could be refactored to improve encapsulation and readability.
Definition:
Refactoring is the process of fixing code in place without impacting on the
rest of the program (1 mark) – mostly to fix problems before they occur or
to improve readability or maintainability (1 mark).
Refactoring rules:
When refactoring, methods and variables may be made more visible, but
they cannot be made less visible (1 mark).
The functionality of public methods cannot change (1 mark).
The return type of a method cannot change (1 mark).
The name of a method or public/ protected variable cannot change (1
mark).
Total: 10 Marks
Page 9 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 9
a) Explain the role of static modelling and contrast this with the role of dynamic 8
modelling. Explain why both types of modelling are required when designing an
object oriented system.
b) Object Oriented Analysis and Design (OOAD) allows for iteration. Explain what 2
is meant by iteration and provide ONE (1) reason why iteration is important.
Definition:
Iteration is the process of going back to previous stages of the design
process and adding to or modifying the design (1 mark).
Total: 10 Marks
Page 10 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Marks
Question 10
Description:
Data oriented means that it focuses on the flow of data through a
system
Most of the diagrams emphasise the way in which data is stored,
manipulated, and passed through the system.
Disadvantages:
As systems became larger and more complex, so did the accompanying
diagrams.
Data Flow Diagrams had to be broken down into several sub layers,
making it hard to understand parts of a complex program while also
understanding how the entire program fitted together.
The focus on data led to unwieldy data dictionaries which recorded all
data used in the system and where it was used: these often ran to
hundreds of pages in length.
b) State THREE (3) advantages and TWO (2) potential disadvantages of using 5
Object Oriented Analysis and Design techniques.
Advantages:
OOAD permits for easier decomposition of systems.
OOAD allows for the analysis and design of these systems in relative
isolation.
OO systems tend to be more maintainable.
OO systems also tend to more precisely map the logic of underlying
systems.
Disadvantages:
OOAD is large and unwieldy for large projects.
OOAD suffers disproportionately when classes are badly designed.
Total: 10 Marks
End of Examination Paper
Page 11 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014
Learning Outcomes Matrix
Page 12 of 12
Analysis, Design and Implementation December 2014 Final © NCC Education Limited 2014