ECE493-Topic 4: Assignment 2

Due Date: Tuesday, February 28, 2006 – 8:30AM

Question 1:

Use the Microsoft specialization and at least two of the most appropriate enterprise styles to redesign and improve upon the following abstract architecture.

The architecture is for a chocolate ordering ecommerce system that we only consider presentation and business logic tiers. There are three business logic components – WishlistMaintenance, Catalogue and Ordering, handling a wishlist facility, the chocolate catalogue and the ordering business logic, respectively. Three components present views to interact with the system:

·  WishlistView handles a wishlist for customers, storing lists of chocolates that they would like to purchase at some stage. The view calls WishlistMaintenance to modify customer wishlists. It also calls Catalogue to obtain lists of recently viewed items that the user might want to add to wishlist.

·  BrowsingView enables customers to browse through the catalogue of chocolates. This component calls Catalogue to obtain the catalogue and to display recently viewed items. It also displays a summary of the user’s wishlist, through interaction with the WishlistMaintenance component.

·  OrderingView handles the ordering procedure for customers. It connects to Catalogue and WishlistView to display recently view and wishlisted items that the user might wish to purchase.

Question 2:

You are to design an architectural style for each of the following problems, by applying the most appropriate style out of the six styles we discussed in the lectures.

a)  Design the overall structure of a hospital monitoring system, given access to the following systems/protocols:

·  An administrator uses a Visio-based GUI to maintain a visual design of the hospital, consisting of rooms, beds, patients and hospital equipment. Visio can export and import data via XML.

·  There exists Jini-based middleware software for reading and sending data from and to wireless mobile devices.

·  All the beds, rooms, and equipment are equipped with Jini-compliant sensors. For instance, a room’s sensor might provide a temperature reading, while a patient monitoring sensor might provide the patient’s heartbeat.

Note: Please provide the overall coarse-grain structure which models how the systems/protocols are going to interact to achieve the required solution. There is no need to have a finer-grained view with individual components corresponding to actual pieces of equipment.

b)  Design a HTML editing tool. It should include a GUI similar to the kind used by editors like Microsoft Frontpage. Actually, we will clone the functionality of Mozilla Composer. The editor is to offer four ways to view and edit HTML text: a WYSIWYG view (“Normal”), a WYSIWYG view but with HTML tags made explicit (“HTML Tags”), a view of the raw HTML source (“HTML Source”) and a preview of the HTML as an executable web page in Mozilla (“Preview”). The user should be able to upload and save their HTML files and select between the four views, editing text in one view, switching to another view, then seamlessly continuing to edit in that view, and so on.

Key Points:

·  Do not use more than 5 or 6 components, noting that a component might be given more detail later in design by making it composite.

·  Make sure you specify interfaces in detail. Please do not use more than 3 methods in an interface.

·  Some of these architectures could be solved by combining styles – you may combine styles if you want, but be sure to justify your combination with respect to the questions.

Question 3:

a)  Let s be a set of integers. Write an OCL expression that asserts all the integers of s must be odd.

b)  Let s be a set of strings. Write an OCL expression that appends “_TypeString” to the end of each of the strings in s.

c)  Let s be a set of components. Assume that c.connections returns a set of all components that are connected to a component c. Write an OCL expression that asserts that there is at least one component in s that doesn’t have anything connected to it.

Question 4:

An application App is built solely according to a particular architectural style. Assume:

·  App.components is the set of all components used within App

·  c.connections returns the set of all connections from a component c.

·  c.provides gives the provided interfaces of component c.

·  c.requires gives required interfaces of component c.

·  c->pconnectedBy(I, s) holds whenever c is connected to s via c’s provided interface I

By consider the following OCL constraints on App, what kind of architectural style satisfies these constraints? Explain your reasons.

·  There is a set App.clients and a component App.server such that:

App.components = App.clients.union(Set{App.server})

·  There is an interface IC containing a method A():Bool such that:

App.clients->forAll(c:Component | c.provides->includes(IC) and

c->pconnectedBy(IC,App.server))

·  There is an interface IR such that:

App.server.provides->includes(IR) and

App.clients->forAll(c:Component | App.server->pconnectedBy(IR,c))

·  For all components C in App.Clients, the following contract holds:

Context C::A():Bool

Post: App.clients->forall(c:Component | c^IC())

Question 5:

Assume that we have the following sets and functions over elements of the UML2 superstructure:

·  C->IsConnected(D, I) returns true, if component C is connected to component D via interface I, with D providing the interface I that C requires.

·  App.components returns the set of all components used in an application App.

·  C.Requires returns the set of all required interfaces of component C.

·  C.RConnections returns the set of all components with required interfaces that are connected to a provided interface of component C.

Consider a transformation, T: UML2→COM+, of UML2 abstract architecture diagram App into a component diagram of the COM+ specialization with .NET web-services. The transformation definition is given by the following procedure:

·  T(C:Component) is C with the stereotype <COM+> added. Any provided and required interfaces of C remain provided and required by T(C).

·  For every component C in App.components->select(C:Component | C.RConnections->size()>3)

Ø  add the tag {ObjectPoolingEnabled=true, ObjectPoolingMinPoolSize=2, ObjectPoolingMaxPoolSize=X} to T(C), where X is C.RConnections->size()

·  Then, for every component C included in App.components, we proceed as follows:

Ø  For every interface I in C.provides,

if not App.Components->exists(D:Component | D->IsConnected(C,I)) then

§  add <Webservice> to T(C) (if T(C) doesn’t already contain this stereotype)

§  add the following tag to T(C): {WebService(Namespace="http://localhost/MyWebServices/")}

§  add the following tag to the interface I of C.provides:

{Webmethod=[a1, a2, …, an]} where a1 to an are all the methods of the interface I

Draw the target architecture that results from applying the transformation to the following UML2 architecture. What does the transformation do?

3