[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-2775) package-info.java should be optional:"convention over configuration"

Eric Jung (JIRA) jira-events at lists.jboss.org
Thu Mar 27 14:16:40 EDT 2008

    [ http://jira.jboss.com/jira/browse/JBSEAM-2775?page=comments#action_12405226 ] 
Eric Jung commented on JBSEAM-2775:

@Pete: I've got past the maven problems. Had to define a proxy in maven's settings.xml.

@Norman: The implementation I've written is quite general. It supports any scheme (e.,g http:, ftp:, java:, foorbar:, whathaveyou:) or no scheme (e.g., mydept.mycompany.com). It supports path or no path after the domain. It also reverse the order of what it interprets to be a fully-qualified domain when translating to a java package. In other words, the examples you gave -- java:com.foo.bar and seam:com.foo.bar would currently resolve to bar.foo.com... just as you'd expect. However, this seems a little backwards to me. If you're going to define your own format, you might as well define it in left-to-right order (e.g., java:bar.foo.com and seam:bar.foo.com)

I think we have two options, and I'd like you guys make a decision so I can contribute the right patch:

1. Drop all support for URL-formatted XML namespaces and only support URIs of the form Norman suggests.
2. Support both URL-formatted XML namespaces as well as seam: and java: namespaces.
    a. If #2, should seam: and java: prefixed namespaces be defined in right-to-left or left-to-right order?

> package-info.java should be optional:"convention over configuration"
> --------------------------------------------------------------------
>                 Key: JBSEAM-2775
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2775
>             Project: JBoss Seam
>          Issue Type: Feature Request
>            Reporter: Eric Jung
> Currently, package-info.java is required when referring to custom Seam components in components.xml. However, to further align Seam with the "convention over configuration" philosophy, this file can be optional by making some assumptions:
> 1. In the absence of package-info.java , the XML namespace in components.xml for custom components has a well-defined mapping to a Java package
> 2. This mapping can be defined as:
>   a. The XML namespace must be parsable by java.net.URL, otherwise automatic mapping is aborted
>   a. Protocol (scheme), the www/ subdomain, port, query parameters, anchors (references), and userInfo are ignored, if present.
>   b. The top-level domain becomes the root Java package
>   c. Subdomains become Java packages under the root package, applied in right-to-left order as specified in the URI.
>   d. The path, as returned by URL.getPath(), is mapped to further Java packages such that each path element becomes another Java package appended in left-to-right order
> Examples:
> http://www.company.com/department/product ==> com.company.department.product
> https://company.com/department/product ==> com.company.department.product
> ftp://www.company.org/department/product ==> org.company.department.product
> abc://company.org/department/product ==> org.company.department.product
> company.net/foo/bar/baz ==> net.company.foo.bar.baz
> JIRA isn't displaying my last example correctly. See http://pastebin.mozilla.org/375878 for the last example.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list