Friday, September 20, 2013

nested SDD

SDD (Statement driven development) is a powerfull productivity weapon.

Until now minuteproject SDD configuration was limited to a single statement.
This is enough when you want to query to display a list or graph or even call a store proc.

But often your business need is make of nested action. The output of some query serves as the input for other actions.
This is this capacity to handle multiple successive actions based on statement that is called nested SDD.

Something concrete

Imagine the following scenario
I have DB connections that are stucked and I want to kill them. How I want to do that is via a web application.
And I want to have this application without writing a single LOC and within 1 minute...
Here is the kind of productivity challenge Minuteproject is bound to solve with nested SDD.

Decomposition of the scenario


Oracle DB.


I have DB connections that are stucked and I want to kill them.
It can be reduced in writing 2 queries:

Retrieve the connections (and stucked ones)
select process,sid, serial#, blocking_session from v$session where blocking_session is not null

Kill collections
alter system kill session '#SID,#SERIAL' immediate


The output of the first query (sid and serial#) serves as input of the second.


Those two queries show be enough to get a application in Primefaces for quite handy for the help desked.

Thursday, September 5, 2013

piping generators with minuteproject

There are couple of really interesting generators working based on some input file and execution principles.
It is easy to understand and tooling-oriented. Input 2 Tool gives Result Code.

Minuteproject principle is the same

When working with generators dealing with RDBMS persistence (Rev-Eng or Fwd-Eng), minuteproject can generate initial input for those generators.

This strategy is called generator piping.

Each generator has its own particularities and kind of DSL.
The goal is then to degrade as less as possible the 'other-generator' input in order to keep the added value as high as possible.

Minuteproject is particularily interested by the following OS generators:
  • Liferay Service Builder
  • JOOQ
  • Benerator
  • Roo (input script instructions)
  • RoR (input script instructions)
  • Propel

Tooling to deal with other generators available in minuteproject
  • Plugin
    • write a mp plugin (java bean match target technology specifics)
    • this plugin is available at template level to query target-generator-centric info.
  • Parametrization
    • offer track customization
    • a classical parameter could be the version of the target generator
  • Updatable code feature
    • tune your output without losing your altertions over consecutive generations
  • Enrichment
    • Conventions
      • Some configuration can be tedious because quite verbose, fortunately minuteproject can pin common caracteristics via conventions
    • Aliasing
      • provides indirection level to have DB names look like DB names and Java name matching Java conventions
The main difficulty is to know what is the input for field type (is it an SQL, UML, Java, own DSL type) that has to be treated at plugin level.