1 / 33

Software interactions Anis Charfi, David Emsellem and Michel Riveill I3S Laboratory, Rainbow team

Software interactions Anis Charfi, David Emsellem and Michel Riveill I3S Laboratory, Rainbow team CNRS & Nice University http://noah.essi.fr. Roadmap. Overview Life cycle Implementation in .NET Conclusion. Software interactions Overview http://noah.essi.fr.

Download Presentation

Software interactions Anis Charfi, David Emsellem and Michel Riveill I3S Laboratory, Rainbow team

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. Software interactions Anis Charfi,David Emsellem and Michel Riveill I3S Laboratory, Rainbow team CNRS & Nice University http://noah.essi.fr

  2. Roadmap • Overview • Life cycle • Implementation in .NET • Conclusion

  3. Software interactions Overviewhttp://noah.essi.fr

  4. No modification on the component Reusability Dynamically no recompilation no application restart collaboration notification security storage notification storage Needs Add capabilities to components, compose and coordinate them

  5. Needs class Agenda { void addMeeting(Meeting m) throws Exception{ meetingTable.add(m); } List meetingTable; … }

  6. Needs class Agenda { void addMeeting(Meeting m) throws Exception{ meetingTable.add(m); display.notify("addMeeting: "+m.toString( )); } List meetingTable;; Display display; … }

  7. Needs class Agenda { void addMeeting(Meeting m) throws Exception{ if (security.ckeck(…)) { meetingTable.add(m); display.notify("addMeeting: "+m.toString( )); } else { throw new Exception("Invalid operation"); } } List meetingTable;; Display display; SecurityService security; … }

  8. Needs class Agenda { void addMeeting(Meeting m) throws Exception{ if (security.ckeck(…)) { meetingTable.add(m); database.store(getFullName( ),this); display.notify("addMeeting: "+m.toString( )); } else { throw new Exception("Invalid operation"); } } List meetingTable;; Display display; SecurityService security; Database database; … }

  9. Needs void addMeeting(Meeting m) { meetingTable.add(m); } Default behaviour + void addMeeting(Meeting m) { meetingTable.add(m); display.notify("addMeeting: " +m.toString()); } Notification + void addMeeting(Meeting m)throws Exception{ if (security.ckeck(…)) { meetingTable.add(m); } else { throw new Exception("Invalid operation"); } } Security + void addMeeting(Meeting m) { meetingTable.add(m); database.store(getFullName(),this); } Persistance

  10. Software interactions Life cyclehttp://noah.essi.fr

  11. The Interaction Specification Language ISL 11 Syntax Interaction security ( Object obj, SecurityService service ){ obj.* -> if service.check(_call) then obj._call else exception    "UnauthorizedUser" endif }

  12. Interactions: Life cycle Interaction service patterns interactions agenda1 display1 Interaction notification(Object obj, Display display){ obj.* -> obj._call // display.notify(_call) }

  13. Interaction service patterns interactions agenda1 display1 Interactions: Life cycle Interaction notification(Object obj, Display display){ obj.* -> obj._call // display.notify(_call) } registerPattern Pattern registration

  14. Interaction service patterns notification interactions agenda1 display1 Interactions: Life cycle Instanciate(notification,[agenda1,display1]) Pattern instantiation

  15. Interaction service patterns notification interactions notification#1 addMeeting() … getName() agenda1 display1 Interactions: Life cycle addRule Pattern instantiation

  16. Interaction service patterns notification interactions notification#1 addMeeting() … getName() agenda1 display1 Interactions: Life cycle interaction security(Object obj, SecurityService service){ obj.addMeeting() -> ifservice.check(_call) then obj._call else exception    "UnauthorizedUser" endif } security Service1

  17. Interaction service patterns notification security interactions notification#1 addMeeting() … getName() agenda1 display1 security Service1 Interactions: Life cycle interaction security(Object obj, SecurityService service){ obj.addMeeting() -> ifservice.check(_call) then obj._call else exception    "UnauthorizedUser" endif } registerPattern Pattern registration

  18. Interaction service patterns notification security interactions notification#1 addMeeting() … getName() agenda1 display1 security Service1 Interactions: Life cycle Instanciate(security,[agenda1,securityService1]) Pattern instantiation

  19. Interactions: Life cycle Interaction service patterns notification addRule security interactions notification#1 security#1 addMeeting() … getName() agenda1 display1 security Service1 Pattern instantiation

  20. Interactions: Life cycle Interaction service Merging patterns + = notification security interactions notification#1 security#1 addMeeting() … getName() agenda1 display1 security Service1 Rule merging

  21. Interactions: Life cycle Interaction service patterns notification AddMeeting security interactions notification#1 security#1 addMeeting() … getName() agenda1 display1 security Service1 Invocation

  22. Software interactions Implementation http://noah.essi.fr

  23. Noah, the implementation • Released version • http://noah.essi.fr Java + J2EE-Jonas .NET extension (June 2003 ) Specialized rotor version (Sept. 2003)

  24. Porting the Interaction Service to .NET Breaking down the Interaction Service Interaction Server ( Java RMI) Interaction Management Interaction Execution Code Instrumentation Component management services

  25. Notifying Msg IsRuleOn (Msg) [Yes] ExecuteRule [No] Execute Msg Execute (Rule) [No] Ret Value [Yes] Ret Value Method wrappers public void addMeeting(String m) { if(MetaObject.isRuleOn(0)) MetaObject.Execute(0, new Object[]{m}); else NOAH_addMeeting(m); } public void NOAH_addMeeting(String m) { List.add(m); } public void addMeeting(String m) { List.add(m); } Code Instrumentation in .NET Message interception Interacting Component Meta Object Executor Method caller

  26. Code Instrumentation in .NET • Reflection API read class metadata: Problems with method bodies and Exceptions • Reflection.Emit API to emit an copy of the class and insert new members (fields, methods): Problems TypeBuilder creates only empty types, No cursor in emitted IL code • CLIFileReader library to read PE/COFF format and copy method bodies and exceptions • We generate a dynamic copy of the input assembly and then modify it Code Instrumentation in .NET Why Code Instrumentation? Components must store interactions, provide methods for adding/removing interactions, provide wrapper methodsfor message interception

  27. Threading: execution of interactions Interaction rule example Team.addMeeting() -> { [1] Team._call ; Anis._call(var[0]) // David._call(var[0]) @1 } ISL tree Concurrency // Sequence ; WaitingMsg @ 0 QualifiedMsg [0] GlobalCall Anis.addMeeting GlobalCall David.addMeeting NotifyCall Rainbow._call

  28. Threading: execution of interactions The execution engine • Interpreter of the ISL tree (analogous to Java Interpreter) • requires thread synchronization (concurrency, waiting) • Namespace System.Threadingfor multithreading and data access • Concurrency: start 2 child threads and block till they exit •  use the method Join() of class Thread • Waitingand Qualified Message: block waiting thread till the qualified message thread exists •  use methods Set() and WaitOne(), class ManualResetEvent • In Java no Join(), no SynchronisationEvents (wait() and notify())

  29. Type Unification Code instrumentation: wrappers for business methods • The wrapper passes method parameters to the execution engine • The execution engine returns the method return Value • a) Java • Differentiates primitive types and classes • wrapping/unwrapping managed by the programmer • classes like Double,Integer… • If the reflection method invoke() returns a Double is it actually a double or a Double ? • b) .NET • every thing is an object: Value types and Reference types • Boxing, Unboxing fully transparent to the programmer • CLR automatically converts value types to objects

  30. Language Interoperability Instrumentation occurs at the Intermediate language Level • a) Java: Byte Code • We can compile several languages to Java byte •  However no real interoperability, No CTS analogous • b) .NET: MSIL • One tool for many .NET languages: C#, VisualBasic.NET, J# … • Language Interoperability: they share and extend each other classes • we support every .NET language that fulfills Common Language Specification

  31. add rule / IML - add rule - remove rule - call .NET method Java Gateway Web Services .NET Gateway Web Services - merge rules - Noah interface - call Java method merge rules / IML method invocation (3) Cross-platform Interactions JAVA .NET .NET Object Http .NET Object TCP Java Object Interactions also possible between Java and .NET components

  32. Conclusion • We can express interactions between components in a language independent way (ISL) • Dynamic component adaptation. No recompilation, No application restart • The same server manages interactions for Java and .NET components • Support of Interactions between heterogenous components e.g. Java and .NET components • Porting the service from Java to .NET enabled us to understand many of the internals of .NET • The interaction model can be easily extended to other component models such as CORBA CCM

  33. Questions http://noah.essi.fr

More Related