Monday, March 8, 2010

Red Samurai Tool - How To Check ADF 11g Package Structure and ADF Task Flow Parameters

In my previous post, I have introduced our JDeveloper 11g extension for ADF code quality validation. I will describe two rules more and will show how you can scan your ADF project for standard guidelines violations. Package structure check and task flow input parameters are documented today.

I'm demonstrating rule execution using updated sample application - RedSamuraiToolTestSample1.zip. Just to remind you, extension can be invoked by right clicking on Model or ViewController project and selecting it from available menu:


I will choose to run Package Structure Check rule:


Several violations are reported for - Application Module, View Link and Association:


Let's double check Model project structure, and we can see that report was correct - we need to fix few things for application package structure:


First, I will refactor Application Module into appmodules package:


If we run same rule again, this time only two violations will be reported - good progress:


We need to complete the rest of refactoring for View Link and Association - whole picture is correct now:


This is confirmed by our extension as well - no more violations for package structure:


Different projects may have different package structure standards, you can customize Red Samurai extension execution through preferences window:


Another rule I will describe - ADF Task Flow parameters naming convention:


Let's assume, we have a standard to give in prefix for ADF Task Flows parameter names. Developer forgot this standard and gave incorrect name - myParameter:


We run our rule to scan for ADF Task Flow input parameters names:


And here we go - rule violation is reported:


When parameter name is fixed to be inLastName:


No more violations for this rule are reported:

5 comments:

  1. Excellent idea. Good tool. Wanted to know how I can use it for multiple projects since each project has its own package structure. Further, can we add our own rules?

    ReplyDelete
  2. Hi,

    At the moment we have only one set of rules per any project. Thanks for suggestion, its really will be an improvement in future versions.

    For new rules, please post your feedback - we will work on this.

    Thanks,
    Andrejus

    ReplyDelete
  3. Thanks for your good tool. I have expected such things from Oracle ;-)

    What's the reason for the error message
    Warning: Classpath entry D:\ora\jdev-11_1_1_2_0\jdeveloper\jdev\extensions\com.redsamuraiconsulting\asm-3.2.jar not found.

    //file asm-3.2.jar really does not exist on this location

    ReplyDelete
  4. Hi,

    Will check this and post update.

    Thanks,
    Andrejus

    ReplyDelete
  5. Hi,

    We have checked this error, its not causing any problems for extension functionality. It is just unused import declared in extension.xml, we will remove it in next release. Thanks for reporting.

    Andrejus

    ReplyDelete