[wildfly-dev] Proposal for improving handling complex types in CLI

Tomaž Cerar tomaz.cerar at gmail.com
Mon Aug 18 10:40:28 EDT 2014


I will continue discussion here, to have broader audience.

Seems most of you are in favor of new map-* list-* operations but not all
of you like idea of enhanced read/write-attribute ops.

To shed bit of light on this. Complex attributes are here to stay and will
always be around.
They are/will be used in lesser extend as in original AS7 code but in any
case there are here to stay.

With extended syntax for write/read-attribute operations I was mostly
thinking of simplifying complex attributes read/write
Also keeping in mind that every object is also a map and can be addressed
and updated as such.
having syntax like we could support simple things like this:
:write-attribute(name=timeout.unit, value="MINUTES)
which we are in dare need of.

as current approach for that is
:write-attribute(name=timeout, value="{value=10, unit=MINUTES}")

where we need to know/change whole object instead of just part of it.

I think having this syntax wouldn't change anything for console at all.
It would however require some work in CLI area, especially if we would want
to have tab completion.

Even today there is metadata that tells what complex attributes are and how
are they structured, we just don't utilize this info.

As it goes for introducing ModelType.MAP I am all in favor of. As it would
allow us also few more things when it comes to
types of map as currently we only have support for Map<String,?> where key
can only be String.
Introducing ModelType.MAP would also require us to introduce few new model
metadata constructs such as key-type.

I discussed ModelType.MAP with Brian a bit, but he was not big fan as that
would require us move all map attributes to use this
which would be a big change (100+ attributes) and this would be big
compatibility issue.
The biggest problem with introducing it is that any object can be
used/addressed as map and as such having extra type bit redundant.

However we could probably introduce it for WildFly 10 (maybe 9) with
jboss-dmr 2.x series.


--
tomaz


On Mon, Aug 18, 2014 at 10:01 AM, Heiko Braun <hbraun at redhat.com> wrote:

>
> I've already commented on the gist, but for the record here's my point if
> view:
>
>
> +1 on the custom operation for list/map modifications.
>
> But I am against the write-attribute changes and generic complex
> attributes . IMO we'd better be explicit about complex attributes and limit
> it to certain usecases:
>
>    - write-attribute is for simple attributes only and yields an error
>    for complex types
>    - no support for generic complex attributes. these should become
>    (child) resources themselves
>    - introduce an explicit ModelType.LIST and ModelType.MAP (i think the
>    former already exists)
>
>
>
> /Heiko
>
>
> On 14 Aug 2014, at 18:31, Tomaž Cerar <tomaz.cerar at gmail.com> wrote:
>
> Hi guys,
>
>
> there ware some discussions on how we should improve handling complex
> types of attribute bit better in CLI.
> For most part that was about Map & List types.
>
> After some discussions with few of you I came up with plan / ideas what
> all options are there for us to improve on.
>
> you can see current state of proposed enhancements at
> https://gist.github.com/ctomc/91055a6f4e7502dcd130
>
> In short, I propose to add set of map-* and list-* global operations and
> improve :read-attribute & :write-attribute
> with EL like syntax for reading / updating map, list and generic complex
> attributes.
>
>
> Let me know what you think about it, especially Console & CLI folks.
>
> --
> tomaz
>
>
>
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/wildfly-dev/attachments/20140818/c98bb044/attachment.html 


More information about the wildfly-dev mailing list