TM354 Final Spring 2018
TM354 Final Spring 2018
1
The elements are:
1. The consumer.
2. The service.
3. The provider
4. The registry (or locator)
1.2
Similarities
They both promote reuse and flexibility.
They both use public interfaces to allow requesters to make use of their functionality
without relying on their implementation.
Differences
A component is implemented in a specific object-oriented technology; only clients
compliant with that technology can easily communicate and integrate with it.
A service uses communication standards that allow the interoperation of diverse
technologies
1. J2SE (Java 2 Platform, Standard Edition): The standard Java language, which Java EE
is built on top of.
2. EJB (Enterprise JavaBeans): A technology for reusable server-side business
components, called enterprise beans.
3. Servlets, JSF (JavaServer Faces) and JSP (JavaServer Pages): Technologies for
constructing web pages and serving them to clients on demand.
4. JPA (Java Persistence API): A technology for accessing relational databases.
5. JMS (Java Message Service). A technology enabling software components to
communicate asynchronously with low coupling.
6. JAX-WS (Java API for XML Web Services) and JAX-RS (Java API for RESTful Web
Services: Technologies for providing services that can be accessed over the internet.
7. JavaMail: A technology for sending email messages
3.1 correctness: how well a system fulfils the customer’s overall objectives
reliability: the likelihood with which a system can be expected to perform its
intended function
efficiency: the level of computing resources (including time) required by a system
to perform its function
3.2 maintainability: the effort required to deal with expected changes and to
understand, locate and fix errors in a system
flexibility: the effort required to modify an operational system
testability: the effort required to test a system to ensure that it performs its
intended function.
3.3 portability: the effort required to transfer the system from one hardware
platform and/or software environment to another.
reusability: the extent to which a system (or system component) can be reused in
other applications.
interoperability: the effort required to couple one system to another.
4.1
Inheritance is the consequence of a generalisation/specialization relationship; a subclass
inherits the features of the superclass. However the term inheritance tends to be used
by programmers, whereas the terms generalisation and specialisation are used by
analysts and modellers.
4.2
You could introduce a new, abstract class named Window and let the other classes
inherit from it as follows:
abstract class Window with operation display
subclass Icon with additional operation maximize
subclass FullWindow with additional operations iconise and scroll.
5.1
5.2
6.1 good software system is one that meets its users’ needs.
6.2 1. Useful: software system should meet users’ needs.
2. Usable: the software should have an interface which is easy to use and user's
friendly.
3. Reliable: errors must be minimized, otherwise users will not be able to
perform those tasks that needs its support.
4. Flexible: software is easy to change as times goes, and by flexibility it will be
easy to correct errors.
5. Available: available in the target environment
6. Affordable: it should meet users delivery date and costs which were agreed on
when signing the contract between the two parties
6.3 Users’ needs will change over time. The time taken to implement the changes in
requirements in a flexible system is less than for less flexible software. As labour
costs are the most significant component of software costs, flexible software is
more affordable
1.1 State chart
1.2 1. Identifying which messages affect which attributes, and considering the
consequences for each object.
2. They help you understand the behaviour of an object over its lifetime.
3. They help you understand how an object or a system must respond to events.
4. They are a means of ensuring correctness.
5. They are a means of elaborating the potential operations within a class.
1.3 Final states are used to show the point or points where the object in question
has finished processing. Its activity has been completed.
1.4 There can be zero, one or more final states but at most one initial state. A final
state can have several incoming transitions and no outgoing transitions, but an
initial state has no incoming transitions and only one outgoing transition.
1.5 An event is something done to the object, such as sending it a message. An
action is something that the object does, such as sending a message to itself or
to another object. An action is an object’s reaction to an event.
1.6 When the object has finished processing or has reached the end of its life and
will be destroyed.
2.1
Lines-of-code metric (LOC): counting the number of lines in a piece of code.
McCabe’s cyclomatic-complexity metric: Measures the complexity of method
by counting number of independent paths through a method body where No
of paths= number of decision points.
2.2
LOC = 13
Cyclomatic-complexity metric = 3
Starting from 1
1+ 1 while loop + 1 if statement = 3
1- Any value >100 or <0 as 101
2- 100
3- 0,1,2…,98,99
3.1 Package diagram
3.2 You should use a package to raise the abstraction level, suppressing any detail in a
particular diagram that is not necessary to understand what the model is showing.
3.3 If you place the two elements in separate packages, they can share the same
name. This is because each model element is identified by its name and the name
of the smallest package that contains it.
3.4 Yes , the Page Generator class can refer to elements in Session Maintenance
3.5 Yes, Database class can refer to elements in Database Interface
4.1 Communication diagram
4.2 Every message has a multi-stage number. The numbers specify the
sequencing, replacing vertical position in a sequence diagram.
4.3 Time is represented by the sequential numbering of messages.
4.4
5.1 Team(ID,name)
Coach(ID,Name, Affiliation)
Participant(Participant ID,Name,Affiliation,Date of Birth,Nationality)
Session(score,schedule)
Contest(Contest Date,Time,Venu)
5.2