Monday, May 5, 2014

WaveMaker: Rapid Web App Generator


Now-a-days web applications are demanded like customers buying goods from the retailers' shops. In fact companies like Google, Apple, Microsoft and others have already introduced concepts like application market or store on mobile and other areas as well. Software applications are no more expected to follow a baby-birth process these days which demands for a high speed rapid application development or generation. During the last few years MDA and other paradigms have attracted us toward meta-programming and different code generators. But they were not matured enough to generate a full-fledged web application so far. 
Looking at the future demand and technology trend, I was in search of such a web application generator which can generate simple web applications for database CRUD (Create, Read, Update, Delete) operations. I was excited with Naked Objects (NO) framework 
(
http://www.nakedobjects.org/) and anticipating a vital outcome on this direction. Eventually Apache Isis (http://isis.apache.org/index.html) attracted me since this is a Java based implementation of NO. It uses But the project is in incubator and has no definite road map for release and the product has some areas still grey. There is another implementation of NO on .NET known as NuGET. Hope readers will pardon my Java inclination here. 
Apache Isis is a framework for rapidly developing domain-driven apps in Java. Write your business logic in entities, domain services and repositories, and the framework dynamically (at runtime) generates a representation of that domain model as a webapp or as a RESTful API. Use for prototyping or production. Apache Isis follows the hexagonal architecture pattern (also known as the onion architecture or ports-and-adapters architecture). It places the domain model in the middle, with presentation, persistence and other services dependent upon the domain model. Though Apache Isis uses a very promising architecture with latest Open Source frameworks like Wicket, JPA, Hibernate and RESTFul communication but the amount of change to be made to enable it for professional usage is little de-motivating.
On continuation of my search someone referred WaveMaker ( http://www.wavemaker.com/) to me. While exploring WaveMaker (WM), ultimately I felt like I found something which falls in line with my hunt. WM is easy to deploy and learn. They have nice videos and tutorials to jump start development. The nice and browser based integrated development environment (IDE) for development and deployment. Most of the well known databases can be integrated with the IDE with export and import features. The IDE offers options to develop entity objects that can be engineered forward onto database tables. Also when the existing tables can be imported to WM, it generates entity objects automatically. WM uses DOJO for frontend code generation and hibernate for object relational mapping (ORM). 
It can also link with LDAP or database for user authentication and authorization. It uses a panel with DOJO and HTML elements to be use on the GUI by simple drag-drop feature. Each element has its own property panel that reminds me of IDEs like JBuilder, Visual Age, Power Builder and Visual Studio. It uses Tomcat as an embedded server to run the IDE and test run applications. WM provided limited numbers of GUI templates with pre-generated style-sheets which can be further modified in the IDE.

Wednesday, October 9, 2013

Integrated Software Development Factory: An Idea

Software Development: The Process


Software development and delivery process is the backbone of business for a professional organization in software industry. Software development is a team activity involving more than one professional with defined set of roles and responsibilities. The involvement of multiple people in the process requires a well defined work flow to be maintained. Apart from human resources the software development process (SDP) typically requires development software tools, platforms and hardware infrastructure and most importantly a strong collaboration mechanism within the team involving the artifacts of the delivery.  Ideally a software development and delivery process (as per the water falls model) involves certain technical steps or phases as briefly described below. Phases including financial, business and management activities such as scoping, estimation, planning are not included here.

Requirement Study & Analysis: Where a person (Requirement Analyst) interacts with the user or customer to understand the process and requirement that the software (to be developed) should implement. The information captured in this phase is generally captured in Software Requirement Specification (SRS). Test cases to validate the system (after development) are also defined following this phase.

Architecture & Design: Specifying and documenting the architecture and design for the software system to visualize the basic structure or model which should be followed to construct the software system. This phase can have two primary steps such as - 
·         Defining the business architecture or functional design by covering the business processes and logic
·         Defining the technical architecture or system design explaining the structure of system components required to implement the business processes.
Design and Architecture specifications are documented in this phase.
Development & Coding: In this phase, different software components are built or developed according to the design specified in the previous phase and tested. The outcome of this phase is source code and executable code.
Deployment & System Testing: All components developed are put together and tested to evaluate the ability of the system to provide the functionalities specified during the requirement capturing phase. Test cases defined during the requirement capturing phase are executed in this phase and test results are captured and defects found during testing are fixed.
User Acceptance: Once system testing is completed the software is submitted to the customer for final acceptance. This phase ideally have customer testing involvement. Defect fixing activities (if any) are also involved in this phase.
Operation & Maintenance: Once the software is accepted by the customer, it is finally delivered and installed for final use. In case any change in requirement takes place or any problems are identified by the customer after the delivery is done, necessary changes to implement new requirement or to fix problems are implemented in the system. In this case a new waterfall (starting with Requirement Analysis phase) can be followed for each new requirement or defect. Please refer to the waterfall model at http://en.wikipedia.org/wiki/Waterfall_model.
Monitoring & Tracking: Overall monitoring and tracking activities for the entire project are performed by a project manager (PM) throughout the phases of a software development lifecycle (SDLC).
The steps mentioned above are depicted in figure 1 below.
Figure 1: Software development lifecycle phases


Pain Areas in the Process


Æ      Majority of employees in a software development organization (SDO) are involved in the process of software development for customers. The development activities (projects) are performed by forming project teams consisting of different people. Typically a lead or manager is involved to monitor and track a project. Apart from the project team members (PTM) other stakeholders such as reviewers, users and customer also get involved throughout the lifecycle of a project. Nowadays most of the stakeholders come from different geographic locations even with different time zones. This is the reason why a project requires a strong collaboration mechanism to be in place.
Æ      Usage of standard practices, software tools and frameworks increases the efficiency of the software under development by reducing defects and improving performance, flexibility, extensibility etc. Enforcing standards and best practices over a team of people can be a challenge without a centralized control and strong collaboration.
Æ      The process of requirement study & analysis does not only involve human interactions, it can also involve several documents and pre-existing software systems as well. Sometimes existing source code from the previously existing system can also be taken as the input for requirement. Recovering the design and logic from an existing system or source code might need a reverse engineering mechanism to be in place.
Æ      Proper event tracking technique always helps in getting everyone in a team notified about the latest updates and help them to react promptly.
Æ      The next problem commonly faced is increasing gap in communication which often results in a big difference between the requirement and the development software system. Figure 2 illustrates the same with a popular cartoon. Usually this problem leads to wastage of investment and following rework.

Figure 2: Gap between requirement and implemented system

Æ      Misunderstandings in certain areas of requirement between a person with and without software background create major problems in communication as illustrated by the famous Dilbert Cartoon in figure3. Ideally a predefined flow of communication and precisely designated requirement capturing interface with relevant questions and clarifications can help in reducing such gaps. Educating the stakeholder (without software background) a little also helps here.

Figure 3: Misunderstanding in requirement capturing

Æ      Communication Gaps can exist between the requirement analyst (who understands the requirement from the customer or user) and the architect or designer which can be minimized by recording requirement with all necessary information which can help the architect or designer. Similar gaps can exist between designer and developer which lead to defects introduced during development phase.
Æ      Sometimes manual effort spent in build, deployment and installation procedures leads to human dependency. This process can be made automatic and time-driven with the help of a Continuous Integration (http://www.thoughtworks.com/continuous-integration) technique.
Æ      Rather than putting the test cases in document only and executing manually during the testing phase, Test Driven Development (TDD) Tools can be used to record the use cases and execute them automatically by integrating the same with Continuous Integration tools. Martin Fowler’s article (http://www.martinfowler.com/articles/continuousIntegration.html) on Continuous Integration explains this more clearly.
Æ      Overall a central repository with version control mechanism is a very important component to keep all artifacts which are referred (e.g. customer supplied documents) and produced (e.g. SRS, Design Document, Source Code etc.) during a project secured.

Goals to Achieve


The primary goal of software development process is to produce deliverables according to requirement with expected quality. The artifacts produced by a project which can be treated as deliverables are usually the SRS, architecture document, design document or source code etc. The final goal of a software development project should ideally be a working piece of software meeting customer’s requirement.
During SDLC, injection of defects is inevitable. Defects are introduced in different phases of a software development project such as Requirement Analysis, Design or Development. The impact of defects on delivery process and cost to fix them is directly proportional with time. The bugs discovered at the end of the SDLC would cost more to get fixed. So it is better, to find problems in the initial state of SDLC and fix them at the earliest. Based on a study (https://buildsecurityin.us-cert.gov/articles/best-practices/code-analysis/business-case), it has been found that, the savings potential from early defect detection is huge; nearly 60 percent of all defects usually exist by design phase.  Figure 4 shows how the cost to fix a defect increases with time.
There are certain techniques such as Pair Programming (PP), Continuous Integration (CI), and Test Driven Development (TDD) etc. which are found to be highly effective in catching the bugs early. While we think of an integrated software development environment (ISDE) as a solution, these techniques need to be considered as well. So we are assuming that, our solution will be equipped to facilitate such techniques. For this article, let’s assume a name for the solution as Integrated Software Development Factory (iSDF).

Figure 4: Increasing Cost to Fix a Defect with time

Integrated Software Development Factory (iSDF): In Search of a Pain Killer


A discussion on so many pain areas together is enough to get a strong headache for anyone. So if we quickly look for a pain killer, a solution to address all primary pain areas in developing a software solution or system, we need to map the resolutions of the pain areas as use cases to the pain killer. Let’s name this pain killer as Integrated Software Development Factory (iSDF). Typical use cases for iSDF deduced from the pain areas described above are the following.
·         Submit Requirement:  The software end-user or customer should be able to enter his / her requirement in our iSDF using a graphical user interface. The customer should also be able to submit associated documents supporting the requirement. The requirement will be stored in system and later referred by other involved in the project team. Once a requirement is submitted, all relevant stakeholders such as requirement analyst, PM and architect should be notified to take necessary actions to process the same.

·         Study & Analyze Requirement: The requirement analyst should have an interface to view the requirement statements and supporting documents entered by the customer for analysis. The analyst should also be able to interact with the end-user / customer for clarifications on the requirement. The analyst should be able to produce and submit an SRS document according to pre-defined format or template. Once the SRS is submitted, required stakeholders such as PM and architect should be notified to take necessary actions to process the same. iSDF should capture requirement in predefined format such as use case or user story so that other PTMs can refer to the same following a specific standard and paradigm (e.g. Object-Oriented Paradigm). Specially, the designer should be able to refer to the use cases or user stories by using a design tool integrated with iSDF. This will help in reducing the interpretation gap between requirement and design.
·         Define Architecture: iSDF should provide an interface for the Architects to view SRS and define the architecture for the software application based on the SRS submitted by the analyst. Relevant project members such as PM and architecture reviewer should be notified while architecture is defined and submitted in iSDF.

·         Review Architecture: Once the architecture is produced, a technical reviewer should be able to review the architecture and provide comments on the same. The architect will incorporate changes suggested by the reviewer (if any) and update the architecture document. Proper notification mechanism (to PM and Architect) should be in place on review comments submission.

·         Define Test Cases: iSDF should provide an interface for the Testers to view requirement and define required test cases for software application based on the SRS submitted by the analyst. Relevant project members such as PM, analyst and customer (if required) should be notified while test cases are identified and submitted in iSDF.

·         Review Test Cases: Once test cases are produced, a reviewer (ideally analyst or business users) should be able to review the test cases and provide comments on the same. The test case creator will incorporate changes suggested by the reviewer (if any) and update the test cases. Proper notification mechanism (to PM, analyst and other concerned members) should be in place on review comments submission.

·         Define Design: Once the architecture is finalized after review, the designer should be notified to start producing the software design. iSDF should provide an interface for the designer to view the requirement (in form of use case or user story), architecture and supporting documents such as SRS and architecture document. The designer should be able produce the software application design by using some design tools integration with iSDF and submit. Once submitted iSDF will store the design and relevant documents and notify the PM and design reviewer.

·         Review Design: Once the design is created, a technical reviewer should be able to review the design and provide comments on the same. The designer will incorporate changes suggested by the reviewer (if any) and update the design document. Proper notification mechanism (to PM and designer) should be in place on review comments submission.

·         Develop & Build: The next phase to design is development and build, which primary includes the generation of source code in desired programming languages, customization and configuration. The developers should be provided with proper interface (in iSDF) to be able to build or develop software applications to work in this phase.
Integrated development environments (IDE) like Eclipse and NetBeans are few examples of development tools which can be integrated with iSDF so that, design models (e.g. UML) can be viewed and referred using the IDE. Code generation options can also be integrated to generate code from the design models whenever required. The source code, configuration files and other associated artifacts produced during this phase should be stored in a centralized repository secured by a version control system such as Git, SVN and CVS etc. so that everyone in a development team should be able to share and update the source code as required.
An automatic build tool can be integrated with iSDF so that, the build process can be scheduled in a periodic manner or based on an event (such as on any update in source code repository). Usually this feature is available in typical Continuous Integration (CI) tools like Hudson, Apache Gump and CruiseControl etc. Once triggered by a time-driven or a event-driven approach, the scope of activities for a CI tool should be to check out the source code and configuration files from version controlled repository, compile and build the same, deploy the application on an execution platform e.g. an application server for a test tool to start testing.
Technical reviewers should be notified on any code change or repository update so that, the new code change can be reviewed. 

Figure 5: iSDF use cases


·         Review Code: Once a new code or modified piece of code or other artifacts are submitted in repository, a notification should be send out to assigned reviewer to review the new or modified artifact and provide comments or approve the change. Once the comments or approval is posted the concerned developer or changer should be notified by iSDF notification mechanism. For any clarification, an integrated collaboration mechanism can be used by the reviewer and changer if required. To support required activities during the review, a code review interface, a notification, a collaboration mechanism and workflow should be in place.

·         Test: This is an important phase in a SDLC. iSDF should have an interface for the testers to produce test cases associated with the requirement of a project during the requirement analysis phase. Once the development is completed, testers should be able to configure the test cases in automated testing tools integrated with iSDF. For example, Fitness is a very useful wiki based tool to implement Test Driven Development (TDD). Such tools can be integrated with the CI layer (within iSDF) so that, build, deployment and testing can be automated removing human dependencies. Once test results are produced, a notification mechanism can circulate the results to concerned parties (e.g. developer, project manager and tester etc.) for further actions.

·         Defect Tracking: Defects can be recorded and monitored using a Defect Tracking tool such as Bugzilla, Jira, Trac, Traxis and Mantis etc. In order to do this, iSDF should be integrated with a Defect Tracking Tool. While defects are introduced concerned parties can be notified by the system for further actions.

·         Deploy & Install: Different versions of application execution platforms or environments for development, testing, staging and production can be set up and integration with iSDF so that, once the application is developed and tested is can be easily deployed or installed on a designated execution environment. Developers can use a development environment to deploy and perform unit testing on their code. On completion of development and code review, individual code changes can be integrated and deployed on a testing environment for the testers to start testing. Once the testing is over, the tested application can be deployed on staging environment for customer’s acceptance testing or review.

·         Acceptance by Customer: Our iSDF solution should also provide an interface for the customers or business users to test and review the completed application and provide final acceptance or sign off. Typically, a staging environment and an interface to report defects are provided for customer acceptance testing. The defect reporting interface should have notification capabilities to keep the concerned parties informed.

·         Monitor & Track SDLC: Apart from an event based notification mechanism, iSDF should also provide a facility so that the entire SDLC followed in a project should be monitored and tracked by a project manager and other concerned stakeholders on a regular basis. Usually the progress of a project, issues and defects are the primary items of interest for monitoring.

·         Administration: Capabilities like User management, user authentication, authorization, project creation, project member allocation can be implemented as administrative activities required for iSDF.

Recipe of a Pain Killer: The Solution

In order to implement the abovementioned use cases certain technical capabilities will be necessary for our iSDF. These capabilities (listed below) together can be considered as a good recipe for iSDF.
*      iSDF should have a Web based Graphical User Interface or portal to be able to provide all user interfaces required for requirement submission, requirement analysis, collaboration and document management.
*      A Workflow Management Framework will be required to manage workflows and human interactions in terms of requirement analysis and reviews etc.
*      A Software Design Tool or interface should be integrated with iSDF so that, the requirement documents or SRS can be referred by the designer and design the software accordingly. Ideally a use case model prepared by the requirement analyst should be captured and shared among relevant users within iSDF in a predefined format so that the design tool can interpret the same as the starting point of design. Apart from preparing design models (e.g. class diagram, sequence diagrams and activity diagrams etc.), the designer can also prepare a design document and store the same in centralized repository of iSDF. The centralized repository can be controlled by version control systems to secure the documents.
*      A Code Generation feature can be added to iSDF to generate initial code structure from design. For example, once the designer completes class diagrams for an application and executes the code generator on the same, the code generator should be able to read the class diagrams and generate initial source codes in desired programming languages (e.g. Java, C++, C# etc.). Once the initial source code structure is generated, they can be stored (checked) in a version controlled repository for reference later by the developers.
*      Development Tools or environments can be integrated with iSDF, where developers can check out the existing source codes from version controlled repository, modify the code, compile and check in the modified code back in the repository. Once there is an update in source code repository, an automatic event or notification should be generated in iSDF that should trigger the build process (through a CI tool).
*      A Reverse Engineering facility of iSDF can help in generating design models from code (in case existing source codes are referred as requirement artifacts). For example, class diagrams can be generated from Java source code.
*      A Reusable Component Repository (containing standards, frameworks, reusable code etc.) should be available with iSDF for the designer, architects and developers to refer to and reuse during architecture definition, design and development.
*      An Email Notification mechanism to notify members involved in a project or administrator whenever there is a change in repository. For example, the PM and requirement analyst should be notified whenever the customer or business user submits a requirement. Similarly architects, designers should be notified whenever the SRS is finalized and code reviewers should be notified once there is an update on source code.
*      A Collaboration Framework for the geographically distributed members to collaborate within each other during a review, analysis and general discussions. The mode of communications can be implemented through chat, email, desktop sharing and video chatting etc.
*      A Continuous Integration platform or tool to automate build, testing and deployment processes should be implemented in iSDF. This is make the process of compiling, building source codes and deploying application packages on desired execution platforms e.g. application or web server etc. Once an update is made on source codes by the developers and automatic event will be generated which will trigger the CI tool to start the build and deployment process. Figure 6 depicts  a typical continuous integration process.
*      A Build Tool should be provided as an integrated feature of iSDF. This tool should ideally be integrated with the CI component so that, whenever there is an update in code repository this tool can be automatically invoked based on an event. On invocation, the tool should be able to check out the latest source code changes from the code repository, compile, build and deploy the same on an execution platform (e.g. application server) for execution. Some popular build tools used nowadays are Apache Ant, Apache Buildr, Apache Maven, Cabal, Gradle, Bamboo etc.
*      Integrated Testing Tools for software application testing should be provided as an important feature of iSDF. The testing tools which can implement a test driven development (TDD) process such as Fitnesse. It should provide the feature to configure the test cases and test data in it. The testing tool should be integrated with the continuous integration tool or platform so that, on each update in source code or application configuration, testing can be executed automatically and the results can be shared (using email) with appropriate stakeholders. Ideally when the application is built and deployed on the execution platform (e.g. Application Server), the testing tool should start executing the test cases which were already pre-configured in it.

Figure 6: Continuous Integration Process

*      A Defect or Bug Tracker tool can be integrated with iSDF to manage and track defects. These tools can be integrated with iSDF to register and track bugs or defects found during testing. Monitoring and tracking of defect life cycle and maintaining a defect repository for further analysis are important aspects of this.
*      A User Authentication & Authorization mechanism to authenticate and authorize users (preferably directory service integration will be a modern technique for this) should be integrated with iSDF. This will enable security and restrict user access based on authority.
*      Reporting Tool is a significant component for any application software. For iSDF, the customer, project manager and other designated stakeholders can monitor and track the software development process by using desired web based reporting interfaces or dashboards.
Figure 7 shows the entire iSDF solution as conceptualized in this article.

Figure 7: iSDF Solution

References


1.     Waterfall model for project management and execution at http://en.wikipedia.org/wiki/Waterfall_model
2.     Continuous Integration technique at http://www.thoughtworks.com/continuous-integration
3.     Martin Fowler’s article on Continuous Integration at http://www.martinfowler.com/articles/continuousIntegration.html
4.     FitNesse, the acceptance testing framework at http://fitnesse.org/

Friday, May 11, 2012

The BAM Book

On Packt publishers' request I reviewed 2 chapters of their BAM book. It has a good coverage and its a concise reading. http://t.co/ZXa3NCGi -- Partha S Sengupta (@psengupta1973)

Saturday, April 30, 2011

Dynamic Proxy: A simple example

The proxy pattern defined by the Gang of Four (GoF) refers to a structure where a method call of an object (proxy) is actually redirected to a method of another object which is a sibling (inherited from the same parent) of the proxy object. The figure below explains a simple proxy.


A simple proxy

A simple proxy typically implements a single method. There are situations when multiple interfaces need to be implemented by a single class to behave in different ways. Dynamic proxy is a mechanism by which we can achieve the same, provided you follow certain guidelines and restrictions. While I was going thru the JavaWorld artcle (http://www.javaworld.com/javaworld/jw-11-2000/jw-1110-proxy.html) on DProxy, I noticed a case where the author is explaining the dynamic proxy with the example of automobiles.


If a vehicle is considered as a system primarily three categories of users can be thought of for the same – a passenger who rides, a mechanic who repairs and a driver who drives. Each one is concerned with the different perspective of the vehicle. On the other hand the vehicle should also be able to present three different interfaces for these users, such as the driver will be interested in the interface of driving which is presented by steering, gear, break, speedometer etc. Similarly the passenger will be presented with the passenger’s seat, door, window, music, television etc, while the mechanic should be able to inspect and repair the engine, chassis, tyres etc.

I tried implementing the case with Java. I will try to explain the same in this article.

To explain the situation I considered mainly six classes.

1. Drivable interface – To represent the interface of a vehicle designated for drivers.

2. Ridable interface - To represent the interface of a vehicle designated for passengers.

3. Repairable interface - To represent the interface of a vehicle designated for mechanics.

4. Vehicle class - To represent a vehicle that implements the three interfaces mentioned above.

5. VehicleInvocationHandler class - To represent the class responsible for creating the dynamic proxy class and map the methods defined in the above interfaces and the respective vehicle. This class in implementing java.lang.reflect. InvocationHandler class add the feature which will enable it to load the interfaces and the vehicle class dynamically at runtime and map them with each other.

6. DProxyTester class – Representing the client which uses the system as a client.
The figure below explains the structural aspect of the system.

The figure below explains the structural aspect of the system.
Dynamic Proxy: The Automobile Case
From the above structure it’s obvious that the client i.e. DProxyTester will remain unaffected from any changes in Vehicle class.


The Java code for the classes and interfaces are given below.


Drivable.java


public interface Drivable {
     public void drive(String source, String dest, int speed);
}


Ridable.java


public interface Ridable {
    public void ride(String[] passengers);
}

Repairable.java

public interface Repairable {
    public void repair(String[] parts);
}


Vehicle.java


public class Vehicle {

  String name = null;
  public Vehicle(String name){
    this.name = name;
  }

  public void move(String start, String end, int speed) {
     System.out.println(name +" is going from "+start+" to "+end+" at a speed of "+speed+"mph");
  }

  public void carry(String[] passengers) {
     for (String str : passengers)
         System.out.println(name+" is Carrying "+str);
  }

  public void getRepaired(String[] parts) {
     for (String str : parts){
         System.out.print(str+", ");
    }
    if(parts.length > 1){
         System.out.println("are getting Repaired on "+name);
    }
    else{
         System.out.println("is getting Repaired on "+name);
    }
 }
}


VehicleInvocationHandler.java

import java.lang.reflect.*;

class VehicleInvocationHandler implements InvocationHandler
{
    Vehicle vehicle = null;
    private VehicleInvocationHandler(Vehicle vehicle){
        this.vehicle = vehicle;
    }

    public static Object getProxy(String name){
       Vehicle vehicle = new Vehicle(name);
    // the proxy can be provided as drivable, ridable or repairable.
       Class[] interfaces = new Class[] { Drivable.class, Ridable.class, Repairable.class};
       Object proxy = Proxy.newProxyInstance(vehicle.getClass().getClassLoader(), interfaces, new VehicleInvocationHandler(vehicle));
       return proxy;
    }
  
    public Object invoke(Object proxy, Method method, Object[] args){
         if(method.getName().equals("drive")){
               vehicle.move((String)args[0], (String)args[1], ((Integer)args[2]).intValue());
         }
         if(method.getName().equals("ride")){
               String[] passengers = (String[]) args[0];
               vehicle.carry(passengers);
         }
         if(method.getName().equals("repair")){
               String[] parts = (String[]) args[0];
               vehicle.getRepaired(parts);
         }
         return null;
    }
}


DProxyTester.java
public class DProxyTester
{
    public static void main(String[] args){
        Object proxy = VehicleInvocationHandler.getProxy("Bus");
        Drivable d = (Drivable) proxy;
        Ridable r = (Ridable) proxy;
        Repairable p = (Repairable) proxy;
        System.out.println("Dynamic Proxy created... ");
        d.drive("Lombard", "Chicago", 60);
        r.ride(new String[]{"Tom", "John", "Harry"});
        p.repair(new String[]{"Wipper", "Head lights", "Gear Box"});
    }
}

Friday, March 4, 2011

BAM: Capabilities & Applicability (Part 5)

CEP: A Brainier BAM
Complex Event Processing (CEP) is a rising rule-based technology that combines real-time information from distributed message-based systems, applications and databases. CEP dynamically searches for patterns and trends that would otherwise go unnoticed. CEP allows enterprises to identify and predict opportunities represented by outwardly distinct events across complex, heterogeneous IT environments. Figure 5.1 shows how CEP extracts these insights. Businesses capture hundreds of thousands of business events to form an event cloud. These events include, updates to customer records in a CRM application, sales in a point-of-sale application, orders scanned upon shipping or delivery, GPS data for delivery trucks and even weather information. Key features of CEP implementation is the ability to model business activities, specifically the dependencies among servers, network infrastructure, applications, people, and processes. CEP uses these models to identify constraints or patterns that map formal or informal processes to expected outcomes. These models provide a framework for designing, automating, and managing intelligent decisions across the enterprise.

Figure 5.1: CEP delivers insight from enterprise events

Implementing CEP
The steps below are required to implement a CEP solution.

1. Enable the enterprise IT infrastructure to capture events.
2. Correlate/match these events to business objects for context and to determine causality.
3. Create the capability to recognize event patterns.
4. Once patterns are recognized, aggregate pertinent event patterns into higher-level event structures also known as “complex” events.
5. Provide business process models and state-based timing expectations (e.g., timeouts/lack of event support) to represent meaningful process transitions.
6. Create the capability to act/react to drive the business object state to mitigate problems or take advantage of opportunities.

Figure 5.2: CEP Systems are noted for their ability to provide insight into operations in real time. They are iterative and can create new events as patterns of activity from employees, vendors, customers, and other stakeholders

Oracle Complex Event Processing (OCEP)
Among the real-time process monitoring and event processing tools Oracle has offered Business Activity Monitor and Complex Event Processing. One can perform real-time detection of specific patterns, across multiple data streams and time windows, through Oracle Complex Event Processing (CEP). One can also gain real-time visibility into operation and performance of business processes, along with the ability to respond to specific situations, through Oracle Business Activity Monitoring (BAM).


At its core, Oracle Complex Event Processing is a Java container implemented with a lightweight, modular architecture based on the Open Services Gateway initiative (OSGi™). It provides a complex event processing (CEP) engine and Continuous Query Language (CQL), as well as a rich development platform without sacrificing performance.


Architecture Overview of OCEP
Oracle Complex Event Processing is architected as a set of relatively fine-grained software modules. Each module contains a set of Java classes that implement some aspect of the server's functionality. A module may act as a library for other modules by exporting classes for client modules to use. A module may also register services in a service registry for use by other modules. The figure 5.3 shows the high level software architecture of an Oracle Complex Event Processing instance. At the lowest level there is a Java virtual machine with deterministic garbage collection (DGC). The JVM provides the foundation for support of applications that demand deterministic latency by limiting the length of garbage collection pauses. The next layer is composed of the modularity framework which allows modules to control the import and export of Java classes. The modularity layer also handles class loading and provides versioning support for classes. The service framework is responsible for instantiating the classes that implement a service and for resolving dependencies between services.
Figure 5.3: OCEP Architecture Overview

Wednesday, March 2, 2011

BAM: Capabilities & Applicability (Part 4)

On The Way to an Agile Enterprise

In many ways BAM can be considered as a key enabler for achieving agility in the business processes across the enterprise. Agility is all about the sustenance to change. It’s the ability of a business to accommodate and respond to a change faster. BAM can address the key pre-requisites to achieve agility in the enterprise:
• Visibility into daily operations and faster response to variations from the normal trend
• Awareness of change both from external and internal sources
• End-to-end view of the processes with important signs, corrective and proactive measures to be taken by the stakeholders.
Figure 4.1 shows how the BAM solutions and the agility pre-requisites are mapped to the example stated in this article. It’s important to identify the key factors that can increase the agility of the business. For example, the business should focus on external sources that are applicable to the domain and identify the stakeholders who need to get notified on the change and also the people who can act effectively. The more quickly the respond state is reached, the more agility the business will gain.


Figure 4.1: BAM for Agility
Optimizing Business Processes

In a conventional technical way BAM does not have capabilities for performance modeling and application tuning which are the key features of performance engineering. But if BAM is considered from the business process point of view, it provides an approach on how to monitor, tune and track the business processes for performance improvement. This feature in turn adds up in achieving agility, responsiveness and resilience to the business. Eventually these are the vital ingredients needed to optimize the performance of a business process.


Solutions and Implementations

There are several distinct Business Activity Monitoring Solutions present today. Some of them are offered by vendors which are focused exclusively on the Business Activity Monitoring sector such as Systar. Most of the realistic Business Activity Monitoring applications in the market come from the primary enterprise software vendors such as Microsoft, IBM, TIBCO and Oracle. These companies were able to sense the future need of BAM in the marketplace and stapled Business Activity Monitoring capabilities with some of their existing software products. For example Microsoft introduced Business Activity Monitoring features to its BizTalk Server suite, IBM added them to WebSphere; and Oracle enhanced its application server offering with Business Activity Monitoring features. Some popular BAM solutions available today are briefly described below.

TIBCO BusinessFactor: TIBCO BusinessFactor™ software enables the development and delivery of performance visibility and business activity monitoring (BAM) solutions that let users quickly understand current operational performance in context of business objectives, past performance and related activities. It collects and correlates data from across the organization, presents information via customizable interactive dashboards, and alerts users when thresholds are exceeded. By performing these functions, the software helps users more quickly and accurately identify and address risks and opportunities.

It Visual representations of data – including maps, blueprints, technical drawings, charts, or graphs – give users the ability to analyze current conditions and performance for any level of location specificity or timeframe to quickly identify trends and predict likely outcomes. BusinessFactor's intuitive user interface shows critical performance indicators and supporting contextual information so users can perform quick historical analysis, drill into data, and take action. BusinessFactor also gives users the ability to collaborate with other users and interact with systems and processes to take appropriate action.

TIBCO SpotFire: By the way, nowadays TIBCO is promoting a more dynamic product in this area called SpotFire. SpotFire Operations Analytics is designed not only to monitor real-time business events but also to create and deliver root-cause analysis applications in response to those events automatically. Unlike reporting or dashboard based tools, those can only provide alerts on operational problems, SpotFire helps in solving problems, by automatically merging real-time monitored data with contextual information from multiple sources into applications designed to find outliers, trends and relationships.

Oracle Business Activity Monitoring: Oracle BAM is a key technology component of Oracle Fusion Middleware and SOA stack of products. It satisfies a rising need to enable Business Executives and particularly operations managers, to make decisions by making real-time actionable information available 24x7. Visibility into key business metrics empowers managers to improve the efficiency of their business processes in a step-by-step approach to process optimization.

Features of Oracle BAM

The proposed Business Activity Monitoring is Oracle BAM. By deploying the SOA framework and using BAM for monitoring the services, business users can derive actionable timely intelligence on their business operations by monitoring the flow of data, service requests, and process invocations. All the components of Oracle SOA Suite including Oracle BEPL Process Manager (Oracle BPEL PM) and/or the integration adaptors can be configured to sends Oracle BAM information emanating from the various integrated application processes using the JMS protocol. With Oracle BPEL PM this can be achieved by leveraging the built in “sensor” technology wherein a part or the entire state of an instance transaction at a process node can be sent to Oracle BAM as a JMS message for further analysis. Oracle BAM can then correlate disparate events that it received, as messages, within the context of pre-defined monitoring models and rules that can relate to business process KPIs to alert business users of process problems and opportunities.

Architecture Overview of Oracle BAM
The Oracle BAM architecture utilizes messaging, data integration, advanced data caching, analytics monitoring, alerting, and reporting technology to deliver requested critical information within seconds of an event or change in status. Because the primary source of data is messages, Oracle BAM is able to update reports and generate alerts at speeds that traditional architectures simply can’t match. Oracle BAM can accept tens of thousands of updates per second into a memory-based persistent cache that is at the center of the Oracle BAM architecture. Any application can send events using Web services or over any JMSbased messaging protocols. Legacy application can integrate with Oracle BPEL PM using custom created adaptors and can in turn integrate with Oracle BAM via the Oracle BPEL PM native sensor architecture. Oracle BAM can additionally also send alerts to external web services when specified threshold conditions within the analytics engine are met. The figure 4.2 shows the Oracle BAM architecture.
Figure 4.2: Oracle BAM architecture


Business process data can be monitored and tracked using by Oracle Business Activity Monitor. Oracle Business Activity Monitoring (Oracle BAM) is a complete solution for building interactive, real-time dashboards and proactive alerts for monitoring business processes and services. Oracle BAM gives business executives and operation managers the information they need to make better business decisions and take corrective action if the business environment changes.

Figure 4.3: Oracle BAM and surrounding components

IBM WebSphere Business Monitor:  IBM WebSphere Business Monitor (WBM) offers real-time insight into business processes.
WBM extends the extensive distributed platform for monitoring of events native to the mainframe platform. It provides business users with a real-time, end-to-end view of business process performance on user-friendly and customizable dashboards, corporate portals and mobile devices, as well as on the desktop. It can improve business results by enabling business users to preempt problems with predictive KPIs and to detect and manage business situations. It boosts up productivity by empowering business users to create new dashboards, KPIs and alerts with minimal IT involvement. It accelerates continuous process improvement and business innovation through a tight integration with other IBM BPM products.
WebSphere Business Monitor V6.1 provides two types of dashboards: Web-based dashboards and portlet-based dashboards. Web-based dashboards are implemented as Web pages. Portlet-based dashboards are a component of WebSphere Business Monitor V6.1 that operates within the WebSphere Portal V6.0.1.1 environment. Figure 4.4 on and Figure 4.5 illustrate the runtime architecture respectively. As indicated by the flow in both figures, you follow this sequence:


1. After you finish the development of the monitor model, export the resulting monitor application that is deployed into the runtime environment (WebSphere Application Server, WebSphere Enterprise Service Bus, or WebSphere Process Server) by using the WebSphere Administrative Console. Ensure that you configure the WebSphere Business Monitor server application to link appropriately to CEI to be registered to consume events from the emitting application.
2. On another server (for example, WebSphere Process Server or WebSphere MQ Workflow), deploy the application that emits events to a CEI server.
3. Upon receipt of the registered event types, the CEI server sends the appropriate Common Base Event to the server registered in step 1.
4. The monitor model executes. It polls for events waiting on the queue, processes them according to the monitor model instructions, and stores business measures to the Monitor database.
Optionally, the monitor model application can obtain real-time event-related data from the event or data source through code that you can provide and invoke as a user-defined XPath function.
1. Optionally, in addition to receiving events as in step 3, the monitor model application can detect business situations (for example, thresholds) and emit events that can be consumed by the WebSphere Business Monitor action services.
2. The CEI server routes events received through the event or data source or the monitor model application to the action services.
3. The action services component takes action such as sending notifications, calling Web services, and invoking Service Component Architecture (SCA) components to perform actions.
Independently, the business user uses the dashboards, which invoke Representational State Transfer (REST) services to return data from the Monitor database and show monitoring results through different views.


Figure 4.4


Figure 4.4 shows usage of the lightweight Web dashboard, which is implemented as Web pages. DB2 Alphablox package installation is optional and is only the prerequisite for use of the dashboard’s dimensional and report views.
Figure 4.5
Figure 4.5 shows usage of the Portal dashboard, which uses WebSphere Portal Server to invoke a REST service. DB2 Alphablox package installation is optional and is only the prerequisite for use of the dashboard’s dimensional and report views.

Systar Business Activity Monitoring for Telecom: Systar Business Activity Monitoring (BAM) enables telecom firms to go beyond simply monitoring network and IT infrastructure processes, instead delivering a clear, 360-degree view of how incidents affect the health of critical business services that must seamlessly flow together.
Systar BAM enables organizations to improve operational efficiency and service quality through unprecedented real-time insight into core telecom business processes, including: Order fulfillment, Service Activation, Revenue Assurance and Supplier and Partner Service Assurance.

Microsoft Business Activity Monitoring: Pro Business Activity Monitoring in BizTalk 2009 focuses on Microsoft's BAM tools, which provide a flexible infrastructure that captures data from Windows Communication Foundation, Windows Workflow Foundation, .NET applications, and BizTalk Server.
Microsoft BAM allows the user to manage aggregations, alerts, and profiles to monitor relevant business metrics (called Key Performance Indicators or KPIs). It provides an end-to-end visibility into the business processes, providing accurate information about the status and results of various operations, processes and transactions so the users can address problem areas and resolve issues within the business.

The Rarest Skill in Software Engineering · Enterprise Architecture · 30 Years in the Trenches The Rarest Skill in Softwar...