You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Nathan Bubna <nb...@gmail.com> on 2006/08/25 23:14:25 UTC

Re: Bean Introspection

For the record, i'm not actually opposed to allowing public fields to
be introspected.  However, as a practice, i don't believe in making
any fields but static final ones public, so i'm not especially
motivated here.

Perhaps we could start by allowing public static final methods?  What
do other dev folks think?

On 8/25/06, Gyanesh M Khanolkar <gy...@thoughtcircle.com> wrote:
> Hi,
>
>
>
> I have read in many forums for requests to read public fields ALSO incase
> the getters are missing. But it seems we are still going by the JavaBean
> specification which allows us to access the property ONLY via a getter
> variable.
>
>
>
> Preferably we would want to avoid the painful getters as it bloats up our
> already existing code.
>
>
>
> Would it be possible for you to reconsider this approach where
> $UserObj.FirstName will check with the getters : getFirstName() /
> getfirstName() and if both were not found, then it accesses the public
> variable FirstName.
>
>
>
> Introduction of this feature would be of great help as it helps us to reduce
> writing additional code which is often of no use.
>
>
>
> Regards
>
> Gyanesh
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Bean Introspection

Posted by Will Glass-Husain <wg...@forio.com>.
Yes, I think there's a separate JIRA issue on that.

WILL

On 8/27/06, Llewellyn Falco <is...@setgame.com> wrote:
> personally, i like the idea of getting the length from arrays...
> +1
>
>     llewellyn
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
>
>


-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Bean Introspection

Posted by Llewellyn Falco <is...@setgame.com>.
personally, i like the idea of getting the length from arrays...
+1

    llewellyn

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Bean Introspection

Posted by Will Glass-Husain <wg...@forio.com>.
+1 from me too on including this.  I did this in 1.5 with the event
handlers.  Use our various plug in api's to develop useful tweaks to
Velocity functionalty, and include those plugins in the distrib.  In
some cases (including this one), when the contribution is important
enough, I'd put it in the core jar.

Eventually I'd like to tweak my SecureIntrospector a little and
include that in the core as an option.

WILL

On 8/27/06, Henning P. Schmiedehausen <hp...@intermeta.de> wrote:
> "Nathan Bubna" <nb...@gmail.com> writes:
>
> >I do however see little reason not to make the PublicFieldUberspect
> >(or something like it) available in the core distribution.  Many
> >people have asked for this over the years (though less since
> >JSTL/JSP2.0 came out), and it's not trivial to write for yourself if
> >you haven't looked at the uberspector stuff before.  Why not make it a
> >simple configuration change to enable this, rather than a
> >code-a-new-thing and configure change?
>
> I'm +1 here. If code is already available, we can either put it into a
> "contrib" section or include it, document it and not enable it by
> default.
>
> That's basically the same thing I've proposed with "Iterable" support
> for JDK 1.5+
>
>         Best regards
>                 Henning
>
> --
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
> hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/
>
> RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
>    Linux, Java, perl, Solaris -- Consulting, Training, Development
>
> Social behaviour: Bavarians can be extremely egalitarian and folksy.
>                                     -- http://en.wikipedia.org/wiki/Bavaria
> Most Franconians do not like to be called Bavarians.
>                                     -- http://en.wikipedia.org/wiki/Franconia
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
>
>


-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Bean Introspection

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Nathan Bubna" <nb...@gmail.com> writes:

>I do however see little reason not to make the PublicFieldUberspect
>(or something like it) available in the core distribution.  Many
>people have asked for this over the years (though less since
>JSTL/JSP2.0 came out), and it's not trivial to write for yourself if
>you haven't looked at the uberspector stuff before.  Why not make it a
>simple configuration change to enable this, rather than a
>code-a-new-thing and configure change?

I'm +1 here. If code is already available, we can either put it into a
"contrib" section or include it, document it and not enable it by
default.

That's basically the same thing I've proposed with "Iterable" support
for JDK 1.5+

	Best regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

Social behaviour: Bavarians can be extremely egalitarian and folksy.
                                    -- http://en.wikipedia.org/wiki/Bavaria
Most Franconians do not like to be called Bavarians.
                                    -- http://en.wikipedia.org/wiki/Franconia

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Bean Introspection

Posted by Nathan Bubna <nb...@gmail.com>.
On 8/26/06, Henning P. Schmiedehausen <hp...@intermeta.de> wrote:
> "Nathan Bubna" <nb...@gmail.com> writes:
>
> >For the record, i'm not actually opposed to allowing public fields to
> >be introspected.  However, as a practice, i don't believe in making
> >any fields but static final ones public, so i'm not especially
> >motivated here.
>
> >Perhaps we could start by allowing public static final methods?  What
> >do other dev folks think?
>
> Why does it have to be in Velocity itself? Extending the introspector
> and configuring a custom Introspector shouldn't be a hard deal.

First an update from the user list:  Barbara quite deftly convinced me
that this shouldn't be available by default.

I do however see little reason not to make the PublicFieldUberspect
(or something like it) available in the core distribution.  Many
people have asked for this over the years (though less since
JSTL/JSP2.0 came out), and it's not trivial to write for yourself if
you haven't looked at the uberspector stuff before.  Why not make it a
simple configuration change to enable this, rather than a
code-a-new-thing and configure change?


>         Best regards
>                 Henning
>
> --
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
> hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/
>
> RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
>    Linux, Java, perl, Solaris -- Consulting, Training, Development
>
> Social behaviour: Bavarians can be extremely egalitarian and folksy.
>                                     -- http://en.wikipedia.org/wiki/Bavaria
> Most Franconians do not like to be called Bavarians.
>                                     -- http://en.wikipedia.org/wiki/Franconia
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Re: Bean Introspection

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Nathan Bubna" <nb...@gmail.com> writes:

>For the record, i'm not actually opposed to allowing public fields to
>be introspected.  However, as a practice, i don't believe in making
>any fields but static final ones public, so i'm not especially
>motivated here.

>Perhaps we could start by allowing public static final methods?  What
>do other dev folks think?

Why does it have to be in Velocity itself? Extending the introspector
and configuring a custom Introspector shouldn't be a hard deal.

	Best regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

Social behaviour: Bavarians can be extremely egalitarian and folksy.
                                    -- http://en.wikipedia.org/wiki/Bavaria
Most Franconians do not like to be called Bavarians.
                                    -- http://en.wikipedia.org/wiki/Franconia

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org