Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Design Pattern for Java Batch Programs

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am planning to do batch programs in java using POJOs and Unix script for running and scheduling the job.

Which design pattern in java will be better for batch programs?
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is hard to say what design pattern you should use without knowing what problem you actually trying to solve.
However I can give you an idea about your application�s architecture: use Spring as the lightweight container and Quartz as the scheduler and you�ll be able to schedule tasks without running any piece of code. Almost everything could be done through configurations only (no need to use unix crons, Quartz resembles the same syntax).

Second use dependency injection to develop your beans (pojos) and if you follow the ioc paradigm closely with little effort you should be able to deliver testable and easy to maintain code (please notice that there is always a difference between designing a class and designing a testable class). And because you like using design patterns remember about the strategy design pattern (when develop your pojos).

Third use jMock and jUnit in order to fully test and cover your code. For running coverage reports on your code you could use either clover or cobertura. If you apply the strategy design pattern to your pojos you should be able to "inject" mock objects at runtime in order to build test cases that don�t really depend upon any external systems.

Fourth enable PMD and checkstyle when writing code in order to deliver high quality code.

This is probably a lot of work to do but at the end you�ll feel like doing the right things right.

Regards.
 
Anjana Ravindran
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you.. thats really a nice reply. Will explore how this will work out.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're most welcome Ravindran.
 
reply
    Bookmark Topic Watch Topic
  • New Topic