Integration Notes

[Machine Vision, Illumination] [Java, J2EE] [LabVIEW] [ORACLE] [C++] [C#] [Aspect-Oriented Programming] [Embedded] [XP Agile CI] [Software Testing]

Aspect Oriented Programming

OSGi - Dynamic Module System for Java (Interface21) - Ported to .NET(2006/2007)
June 1, 2007,P.J. Connolly, SD Times
OSGi began in 1999 as the Open Services Gateway initiative, but the OSGi Alliance now describes its mission as the creation of a market for “universal middleware.”

Essentially, the OSGi Service Platform is a virtualized SOA that resides in the memory of networked systems. Anyone who uses Eclipse uses OSGi technology, since it provides the component model for the framework.
    The OSGi architecture rests on five core capabilities:
  • Management facility for the application and component life cycle.
  • Secure execution facility based on standard Java code protection features, with additional OSGi-specific security added.
  • Remote management capabilities were essential; CIM (Common Information Model) and SNMP are two of the management protocols that can be used with the OSGi platform.
  • Simplified deployment is possible because the OSGi Service Platform smoothes over the underlying platform differences; the composition of an application or service can be changed dynamically.
  • Supports many protocols.
.NET Frameworks for Aspect_Oriented Programming
Spring framework. (port of Java Spring Framework to .NET)
[Spring.NET]
  • ASP.NET framework supporting Dependency Injection for pages and user controls, bi-directional databinding, data validation, and master page support for .NET 1.1
  • Spring "Services" allowing plain .NET objects to be exported as ServicedComponents, Remoted objects, or Web Service. Exported objects can be configured using Dependency Injection and have AOP aspects applied.
  • Transaction management abstraction supporting programmatic and declarative transactions for any persistence technology.
  • AOP support for classes with virtual methods.
  • NUnit Integration: Aids in writing integration tests. Configuration of test cases via dependency injection and automatic transaction rollback
  • NHibernate 1.0/1.2 Integration: Simplify use of NHibernate and participation in Spring's declarative management
  • ASP.NET AJAX Integration: Export 'plain .NET objects' as web service, configure and apply aspects to them, and then expose inside client side Javascript.
  • Transaction and AOP XML namespaces to simplify configuration. AOP support for methods with out/ref parameters.
Implementations
  • Equinox - Eclipse Implementation of OSGi and fundation of Eclipse plugin model
  • Felix - Apache OSGi implementation
  • Knopflerfish - OSGi complete, open source, OSGi R3 and OSGi R4 distribution.
    notes:
  • Used in: Websphere, Lotus, Eclipse, JOnAS.
  • OSGi System can cope well with multiple versions of modules used in the same time besause of:
    • Strict visibility rules. You can't use reflection; only exported packages are visible - version info is considered. As a result each bundle is a segregated class space
    • Resolution process
    • Understanding versioning
  • It is dynamic: modules can be:
    • Installed, started,stopped, uninstalled, updated at runtime
  • Bundles (Modules) can be published and found at runtime
  • Came from 1999 Java embedded network application needs.
  • At 2006/2007 moved to server side. JOnAS, Open Source implementation by OW2 of the Java EE specification. The stable versions are J2EE 1.4 certified. The License used by JOnAS is the LGPL.
Java Frameworks
    Inversion of Control (IoC) design pattern. [On Java]
  • With the advent of enterprise development, and in particular the J2EE platform, applications began to rely on facilities such as bean creation, persistence, messaging, sessions, and transaction management being provided by an external container.
  • The control of the facilities upon which your components depend is inverted so that external frameworks can provide the facilities as transparently as possible. The IoC pattern formally recognizes the move from traditional components being responsible for the facilities upon which they depend, to these facilities being configured and provided by a separate framework.
[Spring Framework], the leading full-stack Java/J2EE application framework.
[AspectJ. ] Eclipse: AJDT: The AspectJ Development Tool
[JBoss AOP]Aspect-Oriented Framework for Java
  • JBoss AOP is a 100% pure Java framework. All your AOP constructs are defined as pure Java classes and bound to your application code via XML or by annotations. This sections walks through implementing aspects.
  • Invocation objects are the runtime encapsulation of their joinpoint. They contain runtime information of their joinpoint (args, java.lang.reflect.*, etc..), and they also drive the flow of aspects.
[Nanning ]Aspect-Oriented Framework for Java
  • An aspected object consists of a set of mixins. Every mixin is an interface, a target-object and a set of interceptors (advises on method-calls), these interceptors intercept calls on the interface on it's way to the target.
  • An aspected object is used by creating a Proxy with the Reflection API. This proxy will implement all the interfaces of all the mixins by invoking all the interceptors for the called method and finally calling the proper implementation of the target object.
  • Attributes (as Javadoc-like tags in the source code or as an xml-document with the same name as the class) can also be added to classes, fields and methods. These attributes are accesible at runtime.
  • Inherited interfaces will call correct target. If several aspects implement same interface the first one will take precedence. The target of the aspect-class will always take precedence before the rest.
  • An XML-config format that's actually a Jelly-script .
[AspectWerkz ]AspectWerkz is a dynamic, lightweight and high-performant AOP framework for Java
  • easily integrate AOP in both new and existing projects.
  • AspectWerkz utilizes bytecode modification to weave your classes at project build-time, class load time or runtime. It hooks in using standardized JVM level APIs. It has a rich and highly orthogonal join point model. Aspects, advices and introductions are written in plain Java and your target classes can be regular POJOs. You have the possibility to add, remove and re-structure advice as well as swapping the implementation of your introductions at runtime. Your aspects can be defined using either Java 5 annotations, Java 1.3/1.4 custom doclets or a simple XML definition file.
  • AspectWerkz provides an API to use the very same aspects for proxies, hence providing a transparent experience, allowing a smooth transition for users familiar with proxies.
  • AspectWerkz performance is reported in this separate project.
  • AspectWerkz is Free Software. The LGPL-style license allows the use of AspectWerkz 2.0 in both commercial and open source projects.
Aspect-Oriented Programming Tutorials
  • Each method call at runtime is a different join point, even if it comes from the same call expression in the program. Many other join points may run while a method call join point is executing -- all the join points that happen while executing the method body, and in those methods called from the body. We say that these join points execute in the dynamic context of the original call join point.
Industry / org
.
Academic
.
WEB
[Answers.com]
[Contract Programming vs. Defensive Programming, Gary Pollice.] [GoF Aspect Oriented Design Patterns] [Continuous Integration]
[Wikipedia ]



Feedback:


Ajax, Java and PHP snippets.

[Ajax ] [Java IE ] [Java IE ]

Integration Notes

Integration Notes

[Machine Vision, Illumination] [Java, J2EE] [LabVIEW] [ORACLE] [C++] [C#] [Aspect-Oriented Programming] [Embedded] [XP Agile CI] [Software Testing]

[ CAN 2.0 (Bosch basic specification) ]