Date DropDownChoice Component Apache Wicket

July 29th, 2009 Aparna Chaudhary 2 comments

Apache Wicket is yet another Java Web Development framework. But the beauty of Wicket is it provides clear separation of concerns. It doesn’t mix markup and java and saves you from adapting to additional expression language. Wicket templates are simple HTML files with only additional wicket attribute wicket:id. This makes it easy for the Java developers to work on the prototypes created by web designers. If you know core Java, its absolutely no problem adapting to Wicket programming model. Wicket comes with a nice quickstart guide and plenty of examples for using different components.

Read the rest of this entry »

Stop the Blame Game with Perf4J

July 22nd, 2009 Aparna Chaudhary No comments

Performance tracking and monitoring is often a problem with many applications. Especially in systems with distributed SOA architecture, its difficult to identify the services causing performance hit. So its nice, wise and safe always to profile heavy operations in exterprise applications. Theres always a bad day when suddenly system starts showing its true colors by giving sub-optimal performance in production environment. Life is easy at this point, if all the components have runtime performance metrics available for analysis.

Read the rest of this entry »

Clean the mess with XStream

April 9th, 2009 Aparna Chaudhary No comments

xstream

Writing clean, isolated and efficient unit test is often a challenge for developers. Efficient test should cover all the possible business scenarios. To create test for covering multiple test scenarios, you need more test data.

For instance, imagine you are writing a test for some Service component. Now if the responsibility of this service is to just collect some data from DAO Layer and pass it on to Business Delegate, life is easy. You can create a mock for DAO using frameworks like EasyMock and you are done. But that’s not often the case. For testing services with complex business logic, its not sufficient to return dummy data. In this case, we create the expected test data and mock the DAO to return the expected data. If this input seed is a simple object, its few additional lines of code and we are done. But what if the test is dealing with complex data model? Normal practice that I observed amongst developers is some private methods are created deep down the test to generate test data – generateXXX().

Read the rest of this entry »

Thinking Performance

April 7th, 2009 Aparna Chaudhary No comments

Have you ever spent days rewriting the whole application burning the midnight oil? Well, I don’t think you are the only one. In early days of my career I also made similar mistakes or was a victim of mistakes made by fellow developers. Having taken this roller coaster ride, spending sleepless nights fixing the code, I learned a new mantra – Tune Early Tune Often. In most of the enterprise development cycles, performance testing and tuning is done pretty late. Typically we start worrying about it during system testing and by the time (if at all) application goes into UAT phase, performance becomes the critical requirement. So if we are building applications where performance is as important as any other functional requirements, why not invest some time addressing it in early development phase?

Read the rest of this entry »

Query the Future with CEP

March 2nd, 2009 Aparna Chaudhary No comments

Complex Event Processing (CEP) is a buzzword that’s been running around the industry for last couple of years. The concept was introduced by David Luckham of Stanford University who has done over a decade of research in this field. Let’s try to understand some terms that are used frequently in this arena.

An Event is a piece of data that represents that something happened in the real world, or in software system. Events often observe a change in state. e.g. a stock tick or a password change. A linearly ordered sequence of events forms Event Stream. While a partially ordered set of events form Event Cloud. So an event stream could be a cloud but the reverse need not be true.

e.g. Set of all stock trades for GOOG within a 5 minute time window is an Event Stream. While all Stocks sold in a business day is an  Event Cloud. And above event stream could be a part of this event cloud.

Read the rest of this entry »

Beauty of Spring Batch

February 18th, 2009 Aparna Chaudhary 1 comment

Spring source community is coming up with spring batch 2.0 in Q2-2009. Spring batch is the first java based framework for batch processing. I think the decades of experience of Accenture in enterprise batch processing really helped for defining the use cases.

Most of the batch applications need to process high volume business critical transactional data. While doing so some set of non functional requirements (NFR) are sort of mandatory in such applications. These NFRs include performance, scalability, restartability, repeatability. I worked with couple of investment banks and my experience says that such batch applications are developed based on either Messaging model or Multi-threading model. Lot of efforts and time is spent by architects, developers and testers in building this robust infrastructure for batch processing. Also we cannot overlook the cost involved. Whenever you move across projects, you end up creating your own batch processing framework. Sigh!!

Some nice features that are introduced in Spring Batch 2.0 are conditional step execution, finer metadata access control and chunk based processing. To perform chunk based processing, we need to configure the commit-interval in a step. The transaction is committed after number of items specified in commit-interval are processed.

<step id="step1" job-repository="jobRepository" transaction-manager="transactionManager">
      <tasklet reader="itemReader" writer="itemWriter" commit-interval="10"/>
</step>

Given the features provided and use cases handled by Spring batch, it can prove to be the de-facto framework for enterprise batch applications.

Mate vs Cairngorm

February 13th, 2009 Aparna Chaudhary 1 comment

I’ve recently been comparing frameworks for Flex event handling. We are already using Mate in one of our projects. I encountered couple of problems in the usage and thought of exploring other frameworks available on the shelf.

Here are some Pros and Cons of both the frameworks:

Mate:

Pros:

  • Tag based event driven Flex framework
  • Declarative way of Event management
  • Custom Events are inherited from default Flash event; no framework code in the application
  • Uses the event-bubbling to catch the events with the EventMap without defining a bunch of wiring code

Cons:

  • State changes are to be notified explicitly to all the associated views by making use of property injection
  • Application can fail silently when you inadvertently misspell the name of the event parameter; compiler checking on tags in EventMap is missing
  • Chances of bloated MXML file since the Event dispatch logic is composed into the MXML

Cairngorm:

Pros:

  • Singleton Model – Uses Observer pattern to refresh all associated views on state change
  • Command Pattern – Clearly defines the Unit of Work. Reduces chances of bloated MXML files
  • Introduction of Business Delegate can expedite development process in projects with different teams for Client and Server implementation. Delegate can be mocked by the client development team to return dummy data.

Cons:

  • Makes codebase bit verbose
  • Custom events are inherited from CairngormEvent which introduces tight coupling between the application and the framework code

As per me, Cairngorm is more suitable for enterprise application development with huge development teams. Use of command pattern can really expedite the development process. Mate on the other hand is more suitable for small applications. However, I would expect one improvement in Mate to add compiler checking on tags in EventMap. Sometimes it really sucks when you realise there are some typos only at the runtime when you application breaks.

References:

http://www.adobe.com/devnet/flex/articles/cairngorm_pt1.html

http://mate.asfusion.com/

Categories: Flex, RIA Technology Tags: , ,
Get Adobe Flash playerPlugin by wpburn.com wordpress themes