Vous êtes sur la page 1sur 13

SENG422-Final Exam Review

Exercise 1:
While many systems can be implemented using a range of architectural styles,
there are usually features of a problem that encourage the choice of a particular
style in the absence of any other constraints. For the following types of system,
identify what you consider to be their major features and identify the architectural
styles that are likely to be the most appropriate:

(a) A bank auto-teller machine;


(b) A spell-checker used to analyze static files of text;
(c) A program that reformats ‘raw text’ into the page description language
employed by a particular printer.

Exercise 2:
1. What is the purpose of a viewpoint library?

2. What is the name used generically to refer to connectors in a pipe-and-filter


architecture style?

3. What is the difference between a fractal model of software development like


SOMA and a linear model like the waterfall lifecycle model?

4. What type of lifecycle model underlies the Rational Unified Process (RUP)?

5. What is the primary purpose of the WSDL language in the web services
standard?

6. How service composition is best handled in current web services technologies?

7. What is the main difference between service composition and service


coordination?

2
Exercise 2 (ctd.):
8. Which types of connectors can generically be modeled in Service-Oriented
Architecture (SOA).
9. Which types of connectors are supported by current Web services technologies?
10. What is the purpose of message correlation in web services technologies?
How is it performed?
11. What does IIOP stand for, and what is its significance?
12. What is a client stub?
13. What is an object reference?
14. What is marshaling?
15. What does the following IDL code define:
typedef sequence<sequence<float>> temperatureSequence;
3
Exercise 2 (ctd):
16. Because an IDL method can return a value, what is the purpose of out and inout
parameter types?
17. The IDL union type can be used for a parameter that will need to pass one
of a small number of types. Use it to define the type of a parameter that is
sometimes empty and sometimes has the type Value.
18. Why is a oneway method unable to return any value to the caller? Can you
think of a mechanism, using oneway calls, to return a result to the caller?
19. What is the difference between location and access transparency?
20. Which ISO/OSI layers does an object-oriented middleware like CORBA
implement?
21. Explain the difference between naming and trading in the CORBA framework.
22. When would you use naming and would use trading for locating objects?4
Exercise 2(ctd.):
23. What are two most important operations in naming?
24. What are the principal trading operations?
25. What is the difference between service type and an object type?
26. How are service type hierarchies and object type hierarchies related?
27. What are policies used for in trading?
5
Exercise 3:
Consider an aircraft navigation system that computes and displays its global position.
The current position is updated on a regular basis.
The system consists of three units: a Rate Generator, a Global Positioning
Sensor (GPS), and a Display device.
The rate Generator generates periodic pulses refreshing the GPS. The GPS then
computes the current coordinates, and notifies the Display device accordingly. The
display device –receives refresh signal from the GPS, then reads the current
coordinates and updates the display.
1. Select a suitable architectural pattern to model the architecture of the system.
Motivate your choice of pattern.
2. Provide a component communication diagram modeling the interactions
between the components involved in the system.
3. Select appropriate communications patterns for the interactions between the
components involved in the component communication diagram.
4. Provide the component structure diagram corresponding to the above design,
6
and detailed design for individual components.
Exercise 3 (ctd.):
• Rate Generator
– Sends periodic Pulse events
to consumers
• Positioning Sensor
5DWH 3RVLWLRQLQJ 'LVSOD\
– Receives Refresh events
*HQHUDWRU 6HQVRU 'HYLFH
from suppliers
– Refreshes cached coordinates
available thru MyLocation
RateGen GPS NavDisplay facet
Pulse Refresh Ready Refresh
– Notifies subscribers via
Rate
GPSLocation Ready events
MyLocation
• Display Device
– Receives Refresh events
from suppliers
&RPSRQHQW6HUYHU
– Reads current coordinates via
its GPSLocation receptacle
– Updates display
7
Exercise 3 (ctd.):
Component Communication Diagram
2.refresh(coordinates)
1.send(pulse)
<<model>>
<<controller>>
GPS
RateGenerator
3.notify(ready)
4.read(position)
5.update(display) <<display>>
NavDisplay
8
Exercise 3 (ctd.):
Component Structure Diagram
Refresh
<<model>>
<<controller>>
GPS
RateGenerator Pulse
Ready
MyLocation
GPSLocation Refresh
<<display>>
NavDisplay
9
Exercise 3 (ctd.):
Detailed Components Definitions
RefreshTicker
Refresh
<<model>>
<<controller>>
Pulse GPS
RateGenerator
RefreshTicker
Ready
MyLocation
<<interface>>
<<interface>> PosTicker
<<interface>> GetPosition
RefreshTicker PosTicker
GetPosition
PosTicker
Refresh
send(pulse) notify(ready)
read(position) GPSLocation
<<display>>
GetPosition
NavDisplay
10
Exercise 4:
A telecommunication company decides to extend its services by allowing its users
to place calls through the Internet. A user may place a call from a client workstation
using a particular VoIP protocol, or using an IP phone, or from home using his
regular phone.
Phone Servers will register their capabilities with a central server. The central
server plays the role of a load balancer by directing requests to the proper server.
Load balancing will be achieved in this case using CORBA trading service.
Every server or service provider will send to the load balancer the following
information:
- Its location (area codes it can terminate calls to)
- VoIP protocols it can support (MGCP, H323, or SIP)
- Price
- Link quality
When a client places a call it will specify to the load balancer the area code and phone
number it wants to call, the protocol it uses, and the type of service plan the user has
subscribed for. The load balancer will be able to match the request to the proper server.
1. Specify the factors that affect the load balancing process.
2. Provides a sequence diagram showing the interactions between the client, the 11
load balancer, and the server.
CORBA Trading Service
Rationale
•Locating objects in location transparent way
•Naming simple but may not be suitable when
– clients do not know server
– there are multiple servers to choose from
•Trading supports locating servers based on service functionality
and quality
•Naming Ù White pages
•Trading ÙYellow Pages
12
Trading Operation
•Trader operates as broker between client and server.
• Enables client to change perspective from ´who?´ to ´what?´
• Similar ideas in:
– mortgage broker
– insurance broker
•Clients ask trader for
– a service of a certain type
– at a certain level of quality
•Trader supports
– service matching
– service shopping
•Server registers service with trader.
• Server defines assured quality of service:
–Static QoS definition
–Dynamic QoS definition
13
Service Type Definition
•Service types define
– Functionality provided by a service and
– Qualities of Service (QoS) provision.
• Functionality defined by object type
• QoS defined based on properties, i.e.
– property name
– property type
– property value
– property mode
• mandatory/optional
• readonly/modifiable
14
Exercise 4 (solution): Telephone Service
Factors affecting the Load balancing
-Phone servers register with Trader by specifying their service type
-Clients query the Trader by specifying their needs
-Trader matches clients needs with available services
Phone service: location, VoIP protocol,Price, Link quality
typedef enum {MGCP, H323, SIP} Protocol;
interface PhoneServer { void connect (); }
service internet_phone {
interface PhoneServer;
readonly mandatory property long location;
readonly mandatory property Protocol voip_prot;
readonly mandatory property double price;
readonly mandatory property LinkQuality quality;
}
Client: area code, destination number, VoIP protocol, service plan 15
Exercise 4 (solution-ctd.): Telephone Service
Call Scenario
c: Caller :Trader s: PhoneServer r:Callee
export()
call()
query()
Customer
connect()
connect()
talk()
16
Exercise 5:
Consider a shopping cart application used in an e-commerce website. The application
consists of a Customer component, a Shopping Cart component, and a Checkout
component.
The Customer component maintains the customer account information. When a
customer comes to the site and logs in, the application will find his record and
account number for use during the session, and create a new shopping cart so he
can start shopping.
A shopping session starts when a customer puts the first item into his shopping cart,
and ends when he checks out. The checkout component generates a bill and a
shipping order from the contents of the shopping cart.
1. Provide a component communication diagram modeling the interactions
between the components involved in the system.
2. Extend the above communication diagram by taking into account the fact that
payments are conducted through a remote server maintained by the credit card
verification center.
3. Assuming that the payment service is a remote CORBA service, provide the
CORBA IDL code for corresponding service. 17
Exercise 5 (ctd.):
1. Component Communication Diagram
shopping(start) shopping(cancel)
<<component>> <<component>>
Customer ShoppingCart
add(item)
remove(item)
getCustomerRecord()
getShoppingList()
shopping (end)
<<component>>
Checkout
generateBill()
shippingOrder()
18
Exercise 5 (ctd.): 2. Extended Component Communication Diagram
shopping(start) shopping(cancel)
<<component>> <<component>>
Customer ShoppingCart
add(item)
remove(item)
getCustomerRecord()
getShoppingList()
shopping (end)
<<component>>
Checkout
checkCard(card)
processPayment
(amount,card) generateBill()
shippingOrder()
<<component>>
CreditCardCenter
19
Exercise 5 (ctd.): 3. CORBA IDL code for Payment service
module payment{
enum CardType {visa, amex, mastercard};
struct Date {
long day;
long month;
long year;
};
struct Card {
CardType type;
long number;
long security;
Date expiration_date;
};
interface CreditCardCenter{
boolean checkCard(in Card _card);
boolean processPayment(in double amount, in Card
_card);
};
}; 20
Exercise 6:
Consider an online vacation planning application operated by a company.
The company sells adventure packages for vacationers. This enterprise is
considering going online.
To do so, the enterprise needs to create a Web site, and it is considering
having that site take advantage of the benefits of Web services. The enterprise
is especially interested in using Web services to integrate with its numerous
partners.
The application:
- provides customers with a catalog of adventure packages
- lets the customer build his or her particular trip experience, choosing
accommodations, transportation, and scheduling various adventure activities,
and finally booking the trip
-provides customers with additional services, such as enabling them to track
the status of their orders.
21
Exercise 6 (ctd.):
Credit Card
Validate Payment
Center
Plan vacation
Travel Agency
Customer
Book Hotel Book Flight Rent Car
Hotel Airlines Rental Car
Reservation Reservation reservation
System System System
1. Design the community service architecture for the application
2. Based on the community service architecture, identify the system components
and provide corresponding component structure diagram.
3. Provide the service choreography for one of the services and derive detailed
definitions for the service interfaces involved. 22
Exercise 6 (solution):
Community Service Architecture
<<ServiceArchitecture>>
Vacation Planning System Architecture
<<Participant>>
:Credit Card banker
Center <<Service
Contract>>
<<ServiceContract>>
:Payment
:Trip Planning Validation
traveller planner
<<Participant>>
<<Participant>> :Planning merchant
:Customer Agent
broker
broker
broker
<<Service <<Service
<<Service
Contract>> Contract>>
Contract>>
:Flight :Hotel :Car Rental
Booking Booking
host leasor
carrier
:Airlines
:Rental Car
Reservation :Hotel reservation
Agent Reservation Agent
Agent
23
Exercise 6 (solution-ctd.):
Community Service Architecture (ctd.)
<<ServiceContract>>
:Trip Planning
browser
<<ServiceContract>> listing
:Catalogue
<<ServiceInterface>> selector
builder <<ServiceInterface>>
traveller:Traveller
planner:Planner
<<ServiceContract>>
:Trip Building
orderer orderprocessor
<<ServiceContract>>
:Ordering
24
Exercise 6 (solution-ctd.):
Component Structure Diagram
<<Participant>> <<Participant>>
:Customer :Credit Card
Center
<<request>>
traveler: TripPlanning <<service>>
<<request>> banker:PaymentValid
<<service>> merchant:PaymentV ation
Planner: alidation
TripPlanning
<<Participant>> <<request>>
<<request>> broker:CarRenTal
broker: HotelBooking :Planning
Agent
<<request>>
<<service>> broker:FlighBooking
host: HotelBooking
:Hotel <<service>>
Reservation <<service>>
carrier:FlightBooking
leasor:CarRental
Agent
:Airlines :Rental Car
Reservation reservation
Agent Agent
25
Exercise 6 (solution-ctd.):
Service Choreography/Service Type
c:Traveller :Planner
planTrip(selection) «interface» «interface»
Planner Traveller
+planTrip(in s:Selection) +postResult(in m:Itinerary)
+refine(in r:Selection)
refine(newSelection)
<<uses>>
postResult(match)
<<serviceInterface>>
TripPlanning
part1: Planner
part2: Traveler
26

Vous aimerez peut-être aussi