1 / 17

Modularizing Web Services Management with AOP

ECOOP Workshop. Modularizing Web Services Management with AOP. María Agustina Cibrán, Bart Verheecke { Maria.Cibran, Bart.Verheecke}@vub.ac.be System and Software Engineering Lab Vrije Universiteit Brussel. Overview. Introduction Web Services Aspect Oriented Programming

filia
Download Presentation

Modularizing Web Services Management with AOP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ECOOP Workshop Modularizing Web Services Management with AOP María Agustina Cibrán, Bart Verheecke { Maria.Cibran, Bart.Verheecke}@vub.ac.be System and Software Engineering Lab Vrije Universiteit Brussel

  2. Overview • Introduction • Web Services • Aspect Oriented Programming • Web Services Management Layer • Architecture • JAsCo Technology • Redirection Mechanism and Hot Swapping • Service Management • Conclusions

  3. Introduction • Web Services • Independent modules • Described, published, localised and invoked over a network using XML-standards • Integrated in client-applications using the Wrapper Approach • Automatically generate client-stub and treat service as an internal component • Used in Visual Studio.NET, Bea Web Logic, etc

  4. Introduction • Problem Statement • Services are hard-wired in application • How to adapt to changes? • What if service or network fails? • How to deal with other service related issues? • Checking of availability, switching to other services, dealing with billing, security, logging, etc • Needs to be provided manually by the programmer • Results scattered and tangled in the application  Use AOP to achieve better separation of concerns

  5. Introduction • Aspect Oriented Programming (AOP) • Tyranny of the dominant decomposition • Impossible to modularize some concerns (e.g. logging) using current software engineering methodologies such as OO. • As a result code gets scattered all over the system • AOP Concepts • Modularize these concerns in Aspects • An aspect defines a set of join points • Weavers to weave aspect logic in the core application

  6. Web Services Management Layer The Wrapper Approach

  7. Web Services Management Layer Introducing the WSML to decouple Web Services from the client-application

  8. Web Services Management Layer Use the WSML to deal with all web service related issues

  9. Web Services Management Layer • Core Functionality • Decoupling of Services from application • Redirection of application requests to service invocations • Hot-Swapping • Switch between services at runtime • Advanced Service Selection and Monitoring • Select services based on business driven requirements • Service Management • Security, logging, billing, transaction management, etc

  10. Web Services Management Layer • Use of JAsCo Technology • Dynamic Aspect Oriented Language • Introduces two new concepts: • Aspect Beans: • specify crosscutting behaviour in a reusable manner: • When the normal execution of a method should be intercepted • what extra behaviour should be executed at those points. • Connectors: • Specify deployment details: • where the crosscutting behaviour should be deployed.

  11. Web Services Management Layer

  12. Web Services Management Layer • Hotel Service Example

  13. Web Services Management Layer • Code Example 1 One Aspect for each request 1. Class ListAvailableHotelsAspect { 2. hook RedirectionHook { 3. RedirectionHook(method(..args)){ 4. execute(method); 5. } 6. replace() { 7. return specificMethod(args); 8. } 9. abstract public String specificMethod(args); 10. } 11. } Hook specifying to replace method (..args) with specificMethod (args) specificMethod is specified in the connector Redirection Aspect for the request ListHotels

  14. Web Services Management Layer Connector for each Service Invocation • Code Example 1 Hook instantiation 1. static connector HotelServiceC_listHotels { 2. ListAvailableHotelsAspect.RedirectionHook redirectionhook = new 3. ListAvailableHotelsAspect.RedirectionHook(List listHotels(args)){ 4. public String specificMethod(args) { 5. try { 6. Stub stub = new Stub (WebServiceC); 7. result = stub.listAvailableHotels(args); 8. return result; 9. } 10. catch (ServiceUnavailableException e) { 11. WSML.failureNotification ("WebServiceC"); 12. return asi.HotelServiceASI.listHotels (args); 13. } 14. } 15. } 16. redirectionhook.replace(); 17. } Connector for WebService C specificMethod with actual service call

  15. Web Services Management Layer Billing Aspect to bill each time a service is invoked • Code Example 2 class BillingPerUse { hook BillingHook { private int total = 0; private int cost = 0; public void setCost(int aCost){ cost = aCost; } private void pay(){ total = total + cost; } BillingHook(method (Date d1,Date d2,CityCode cc)) { call(method); } after() { pay(); } } } Billing hook Service Management: Billing Aspect

  16. Web Services Management Layer Same connector before, now extended with billing hook • Code Example 2 static connector HotelServiceC_listHotels { … BillingPerUse.BillingHook billPerUse = new BillingPerUse.BillingHook (List listHotels(args)); billPerUse.setCost(2); redirectionhook.replace(); billPerUse.after(); } Instantiation of the billing hook Service Management: Billing Aspect

  17. Conclusions • AOP is suited to modularize Web Service related issues • Use JAsCo to dynamically hot-swap between services and allow runtime management • More flexible applications that can easily adapt to changes in the environment

More Related