[ https://issues.apache.org/jira/browse/PIVOT-560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12884993#action_12884993 ]
Michael Allman commented on PIVOT-560: -------------------------------------- I don't see how the example <Window xmlns="org.apache.pivot.wtk"> <MyCustomComponent xmlns="com.foo.bar"> ... </MyCustomComponent> </Window> suggests any kind of solution to the problem this feature is supposed to solve. As soon as you put a native Pivot component inside MyCustomComponent you're back to square one: defining another namespace. And besides that, who wants to redefine the default namespace whenever the default package changes in a containment hierarchy? More finger-to-keyboard action... The more component packages you use in a wtkx, the more namespace prefixes (or namespace redefines) you need. The status quo is at odds with the way Java packages are split for the sake of separation of concerns. I'm already using components from 4 different packages in one of my wtkx files, and no it's not a huge file. So far it's 24 lines. The components are intermixed in the containment hierarchy. If I had to define a different namespace for each package, I would be prefixing element and static property declarations with at least 3 namespace prefixes. There's no way I'm going back to that. I'm keeping this as an independent patch for now while I think about how to move forward without keeping my own patchset. Cheers. > Permit WTKX namespace declarations to declare more than one in-scope package > ---------------------------------------------------------------------------- > > Key: PIVOT-560 > URL: https://issues.apache.org/jira/browse/PIVOT-560 > Project: Pivot > Issue Type: New Feature > Components: wtk-wtkx > Affects Versions: 1.5.1 > Reporter: Michael Allman > Fix For: 1.5 > > Attachments: multiple_packages_in_one_namespace_uri.patch.gz > > > The attached patch allows this: > <Frame xmlns="org.apache.pivot.wtk,my.custom.component.package" > xmlns:wtkx="http://pivot.apache.org/wtkx"> > <content> > <BoxPane/> > <MyCustomComponent/> > </content> > </Frame> > The obvious benefit of this patch is to (almost) eliminate the need for > alternate namespace prefixes for other packages. If a type name exists in > more than one package, the system throws a SerializationException complaining > that the type name is ambiguous. > To make an analogy, the way things currently are would be like restricting > imports in a Java source file to a single package. Any type from another > package would have to be qualified. This patch allows the Pivot developer to > bring multiple packages into the default (or other) XML namespace. This is a > huuuuuge time (and finger) saver when working with custom components. > Cheers. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.