Presentation is loading. Please wait.

Presentation is loading. Please wait.

21 September 2006Kaiser: COMS W4156 Fall 20061 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser

Similar presentations


Presentation on theme: "21 September 2006Kaiser: COMS W4156 Fall 20061 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser"— Presentation transcript:

1 21 September 2006Kaiser: COMS W4156 Fall 20061 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu http://york.cs.columbia.edu/classes/cs4156/

2 21 September 2006Kaiser: COMS W4156 Fall 20062 COM+

3 21 September 2006Kaiser: COMS W4156 Fall 20063 Just-In-Time Activation Also known as deferred activation When a client makes a call to an object to create an instance, COM+ provides that client a reference context (using IObjectContext interface) instead of a reference to the object Client gets reference to the object when client calls a method of that object Useful if many clients instantiate an object but few actually call its methods

4 21 September 2006Kaiser: COMS W4156 Fall 20064 Object Pooling Recycling of objects When a client releases an object that supports object pooling, instead of destroying that object completely, COM+ recycles it When another client requests the same kind of object, COM+ gives an instance from the pool Since these component instances are already loaded in memory, they are immediately available for use by client applications

5 21 September 2006Kaiser: COMS W4156 Fall 20065 Resource Pooling Opening and closing connections to a database can be time-consuming Reuse existing database connections rather than create new ones A resource dispenser caches resources such as ODBC (Open DataBase Connectivity) connections to a database, allowing components to efficiently reuse them

6 21 September 2006Kaiser: COMS W4156 Fall 20066 Role-Based Security “Role” = a logically related group of users that share the same permissions to access a defined subset of an application’s functionalities Assign different permissions for different roles on a class, interface or method Can set either administratively (using COM+ Explorer) or via programming Don’t need to write security-related logic into components (but can do so if desired)

7 21 September 2006Kaiser: COMS W4156 Fall 20067 Load Balancing Scalability: network traffic and number of clients shouldn't affect performance of an application Load balancing distributes client calls across server cluster (on business logic tier) transparently to the application Components to be load-balanced configured on per-class basis at deployment: check the box in the Component Services Explorer

8 21 September 2006Kaiser: COMS W4156 Fall 20068 COM+ Router When a client requests a specific component, it first connects to a load balancing router (itself possibly a cluster) Router polls the cluster application servers for timing data (by default every 200ms) Router chooses a server based on lightest server load and availability Modified round-robin algorithm

9 21 September 2006Kaiser: COMS W4156 Fall 20069 Service Control Manager COM+ router’s SCM forwards the activation request to the selected server's SCM If the instantiation of the object fails, the router moves to the next server in the round-robin list Continues until a valid interface pointer is returned to the client From this point, all communication occurs directly between the client and the server that handled the request

10 21 September 2006Kaiser: COMS W4156 Fall 200610 Queued Components Client can execute (asynchronous) method calls, even if the server component is offline MSMQ (Microsoft Message Queue server) records and stores method calls automatically whenever the server object is available Useful for online applications that must be completed (online banking, air reservation system, etc.), mobile users, etc.

11 21 September 2006Kaiser: COMS W4156 Fall 200611 Component Availability In synchronous processing applications, if just one component of a compound activity is not available—perhaps because of server overload or networking problems— the entire process is blocked and cannot complete An application using the COM+ Queued Components service separates the activity into actions that must be completed now and those that can be completed at a later time

12 21 September 2006Kaiser: COMS W4156 Fall 200612 Client/Server Decoupling

13 21 September 2006Kaiser: COMS W4156 Fall 200613 Message Queuing A queue is a storage area that saves messages for later retrieval Provides a mechanism for connectionless communication - sender and receiver are not connected directly and communicate only through queues COM+ Queued Components service automatically marshals data as messages

14 21 September 2006Kaiser: COMS W4156 Fall 200614 Message Reliability Message Queuing uses database techniques to help protect data in a robust way Built-in support for transactions In the event of a server failure, Message Queuing ensures that transactions are rolled back so that messages are not lost and data is not corrupted

15 21 September 2006Kaiser: COMS W4156 Fall 200615 Server Scheduling An application using queued components is well suited to time-shifted component execution, which defers non-critical work to an off-peak period Analogous to traditional batch mode processing Similar requests can be deferred for contiguous execution by the server rather than requiring the server to react immediately to a wide variety of requests

16 21 September 2006Kaiser: COMS W4156 Fall 200616 Original COM Events Choice between two (similar) techniques –Interface callback mechanism –Connectable Objects

17 21 September 2006Kaiser: COMS W4156 Fall 200617 Interface Callbacks Client implements a COM interface described by the event publisher component, and passes a pointer to this interface to the component Client then receives notifications (i.e., events or callbacks) when the component calls a method through the interface implemented by the client code

18 21 September 2006Kaiser: COMS W4156 Fall 200618 Connectable Objects Also known as connection points Exchange of an interface pointer implemented by the client (invoked to notify of an event) Uses COM's standard IConnectionPoint interface (and 3 related interfaces) Connect ( Advise ) and disconnect ( Unadvise ) Enumerate connections ( EnumConnections )

19 21 September 2006Kaiser: COMS W4156 Fall 200619 Example

20 21 September 2006Kaiser: COMS W4156 Fall 200620 COM Events Problems Only a series of interfaces - developers still have to write the code to implement these interfaces Client and component lifetimes are tightly coupled through the exchanged interface pointer - the client must be running and connected to receive events It is difficult to get between a component instance and its clients to monitor the connection, provide trace information, etc.

21 21 September 2006Kaiser: COMS W4156 Fall 200621 COM+ Events Publish-subscribe model rather than request-reply Publishers are not tightly bound to their subscribers and in most cases don't even know who they are Publishers do not block when firing an event Subscribers do not bind themselves directly to publishers - an intermediary object manages communication between a publisher and its subscribers

22 21 September 2006Kaiser: COMS W4156 Fall 200622 Event Class An event class component sits between a publisher of information and any potential subscribers COM+ Events system provides the actual implementation of this intermediate object Eliminates the need to directly pass an interface pointer through an Advise method Publisher and subscriber lifecycles no longer tightly coupled

23 21 September 2006Kaiser: COMS W4156 Fall 200623 Publisher The event class looks like a subscriber to the publisher When a publisher wants to “fire” an event, it creates an instance of the event class, calls the appropriate method, and then releases the interface (as in queued components) The runtime then determines how and when to notify any subscribers

24 21 September 2006Kaiser: COMS W4156 Fall 200624 Subscriber To receive events, need only implement the event interface Registers with the COM+ Events service by creating a subscription object, through the IEventSubscription interface The component will be (activated and) notified as events are published Either persistent or transient subscriptions

25 21 September 2006Kaiser: COMS W4156 Fall 200625 Example

26 21 September 2006Kaiser: COMS W4156 Fall 200626 Example

27 21 September 2006Kaiser: COMS W4156 Fall 200627 Improved COM+ Events Provides a “third-party” publish-subscribe environment: Once an event class is created, anyone can become a publisher or subscriber of the events Supports a rich filter mechanism: one can filter at the publisher method level – allows event class object to decide which subscribers receive a particular event, or at the method parameter level – complex criteria string per subscriber

28 21 September 2006Kaiser: COMS W4156 Fall 200628 Filtering Example

29 21 September 2006Kaiser: COMS W4156 Fall 200629 Individual Development Assignment #2 due Tuesday September 26th CORBA-based distributed computing Implement an AuctionHouse application (this time you submit the code) Choose an ORB –List of free ORBs supporting Java and/or C++ available at http://cmeerw.org/freeorbwatch/http://cmeerw.org/freeorbwatch/ –Warning: the various ORBs support varying versions of the CORBA spec (most supply many more features than discussed in class)

30 21 September 2006Kaiser: COMS W4156 Fall 200630 IDA #2 3 kinds of components: –Supplier: infinite supply of auction Items –Customer(s): submits bids to the AuctionHouse for a given Item –AuctionHouse: sells a limited set of Items to Customers; buys new Items from Supplier Your implementation must support –English Auction mode –Bazaar Negotiation mode –Simultaneous interactions with multiple customers –Re-ordering from the Supplier

31 21 September 2006Kaiser: COMS W4156 Fall 200631 IDA #2: English Auction Customers bid against each other for the same (single) Item within a time limit Customer requests current price (either initial price or highest bid so far) Customer submits bid (same or higher than initial price, higher than highest bid so far) Customer can continue placing additional bids After time limit expires, AuctionHouse does not accept any more bids for that Item and notifies winning Customer

32 21 September 2006Kaiser: COMS W4156 Fall 200632 IDA #2: Bazaar Negotiations Customer haggles with AuctionHouse to purchase an Item, independent of other Customers Customer requests current price (either initial price or price AuctionHouse has most recently offered to that Customer) Customer submits bid (same or lower than initial price, higher than that Customer’s previous bid) AuctionHouse accepts bid if the same or higher than minimum price Otherwise AuctionHouse replies with a new price (always the same or higher than minimum price) Repeat until bid accepted or Customer quits

33 21 September 2006Kaiser: COMS W4156 Fall 200633 IDA #2 Deliverable (archive file) Source code Output files (screen shots, traces) showing one significant system run for each of the modes –Sequence of AuctionHouse activities –Make sure to include interaction with Supplier as well as with multiple Customers 1-page README describing your implementation and instructing on how to compile, install and run it 1-page report on your findings and impressions on CORBA-based distributed computing

34 21 September 2006Kaiser: COMS W4156 Fall 200634 Upcoming Teams announced September 26th Team project concept due October 3 rd Individual development assignment #3 due October 10 th Revised project concept due October 17 th

35 21 September 2006Kaiser: COMS W4156 Fall 200635 Office Hours Prof. Kaiser: Tue/Thu 12:30-1:30, 607 CEPSR Anurag Chakravarti: Wed/Fri 11-12, 7LW1 CEPSR

36 21 September 2006Kaiser: COMS W4156 Fall 200636 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser Kaiser+4156@cs.columbia.edu http://york.cs.columbia.edu/classes/cs4156/


Download ppt "21 September 2006Kaiser: COMS W4156 Fall 20061 COMS W4156: Advanced Software Engineering Prof. Gail Kaiser"

Similar presentations


Ads by Google