Alright, I have a prototype of the XML output.
== Example output ==
<architecture>
<rules> <rule>
<id>dao_layer_rule</id>
<comment>blah blah blah integration</comment>
<packages>
<package>com.company.project.dao</package> <package>com.company.project.dao..*</package>
<packages>
<violations> <package>com.company.project.service</package>
<package>com.company.project.service..*</package> <package>com.company.project.web</package>
<package>com.company.project.web..*</package> </violations>
<matches>
<match>
<package>com.company.project.dao</package> <dependencies>
<dependency>com.company.project.model<dependency> </dependencies>
<violations/> </match>
<match>
<package>com.company.project.dao.hibernate</package> <dependencies>
<dependency>com.company.project.model<dependency> <dependency>com.company.project.service.user<dependency>
</dependencies> <violations>
<violation>com.company.project.service.user</violation> <violations>
</match>
<match> <package>com.company.project.dao.jdbc</package>
<dependencies> <dependency>com.company.project.model<dependency>
</dependencies> <violations/>
</match>
<matches> </rule>
<rules></architecture>
== Explaination ==
First, we define the rule that is being investigated
<rules>
<rule>
<id>dao_layer_rule</id>
<comment>blah blah blah integration</comment>
<packages>
<package>com.company.project.dao</package>
<package>com.company.project.dao..*</package>
<packages>
<violations>
<package>com.company.project.service</package>
<package>com.company.project.service..*</package>
<package>com.company.project.web</package>
<package>com.company.project.web..*</package>
</violations>
This is just a straight up copy from the configuration.
Next, we show each package that matched the given packages, all of the dependencies that they have including the violations, and then the specific violations.
Here is an example that has a violation.
<matches>
<match>
<package>com.company.project.dao.hibernate</package>
<dependencies>
<dependency>com.company.project.model<dependency>
<dependency>com.company.project.service.user<dependency>
</dependencies>
<violations>
<violation>com.company.project.service.user</violation>
<violations>
</match>And an example that does not have a violation.
<match>
<package>com.company.project.dao</package>
<dependencies>
<dependency>com.company.project.model<dependency>
</dependencies>
<violations/>
</match>
So, again, I suspect this XML output can be used in generating an HTML report with the maven site goal. I think the more information we put in here now, the more information we have available to us in the report to be designed later.
One concern is that eventually we are going to figure out how to report the exact class that is breaking the rule. That will need to get into this report at some point. Where does it fit in. Is it something that we can add, or will we need to redo this output to fit it in? So, do we need to figure out the outputting of the class breaking the rule before we can work on this report?
Finally, once we agree on this design, I'd like to try to find someone to work on it. Someone new. Someone other than Mykola or myself. I think if I sent it out to the user list with a clear requirements specification/document that one of those users would be interested in developing this functionality. Unless anyone on this mailing list is interested in grabbing this task.
Please, I need input on this email and the previous post in this thread. Thanks fellas.
~ Mike
~
http://blog.72miles.com