Recursive package syntax

4 views
Skip to first unread message

Joie de vivre

unread,
Dec 3, 2007, 9:25:06 AM12/3/07
to architecture-rules-users
Hi,

what a great tool! Here's an idea to simplify configuration of nested
packages, as they usually have the same rules as their parents:

Here's an example using the example on the project page:

old way:
<rule id="dao">
<comment>dao layer depends on no other layers</comment>
<packages>
<package>com.company.app.core.dao</package>
<package>com.company.app.core.dao.hibernate</package>
</packages>
<violations>
<violation>com.company.app.core.services</violation>
<violation>com.company.app.web</violation>
<violation>com.company.app.web.spring</violation>
</violations>
</rule>

new way:
<rule id="dao">
<comment>dao layer depends on no other layers</comment>
<packages>
<package>com.company.app.core.dao.*</package>
</packages>
<violations>
<violation>com.company.app.core.services</violation>
<violation>com.company.app.web.*</violation>
</violations>
</rule>


cheers,
Sakke Wiik

Mike Nereson

unread,
Dec 4, 2007, 9:25:39 AM12/4/07
to architecture...@googlegroups.com
Hi Sakke.

Thanks for the feedback. I completely agree with you. We need to allow
for wild cards in the package names. In addition to terminating wild
cards, I am aware of many coding standards that would require teams to
have wild cards within the package names as well.

The end result would allow for any of the following...

com.company.presentation.*
com.company.*.presentation
com.company.*.presentation.*

Sakke, I will add this to the issues list and will make it available
in the next release.

Again, thanks for the feedback, keep it coming.

~ Mike Nereson

--
~ Mike Nereson

Reply all
Reply to author
Forward
0 new messages