How about:
shared object one {
shared class Properties {
shared new name {}
shared new id {}
}
}
Or even just
shared object one {
shared object properties {
shared object name {}
shared object id {}
}
}
Or do you desperately need them to be enumerated for some reason?
On Sat, Aug 27, 2016 at 2:22 PM, Wojciech Potiopa
<
wojciech...@gmail.com> wrote:
> Hi Gavin thanks for answering, take a look at this
>
https://github.com/jmurty/java-xmlbuilder
>
> Let have something like this with data presented as literals:
>
> XMLBuilder2.create("Doc").e("one").a("name", "Some value");
>
>
>
> I would like to present data not as literals but as constants, and to have
> changes proof code
>
> XMLBuilder2.create("Doc").e(one.string).a(one.properties.name.string,"Some
> Value")
>
>
> If i would have ten references to
>
> .e("one").a("name", "Some value");
>
> I can't refactore it properly and it's bug prone.
>
>
> Let say want to change one element string representation from "one" to
> "type".
> Then i just refine string property from one object
> String string = "type"
>
> In literal representation must to change every line...
>
> And now i want to have hierarchy to be able to do the same with second level
> objects in this case EnumTwo instances and be sure to referencing correct
> object not just name, because, there can be other representations in my Xml
> model with other name instances of other types. So first it would hard to
> import them and use them in the same file and secondly it is encapsulated
> better and less error prone when changes occurs.
>
https://groups.google.com/d/msgid/ceylon-users/42800e68-5c03-4e6e-8c3a-d289d294c810%40googlegroups.com.