To get my jmonkeyengine demo working, I had to be able to expose a
bunch of protected Java fields to be accessible.  I ended up creating
the following methods (currently implemented in Ruby):

field_attr_reader :java_field_name [, :name_to_expose_as]
field_attr_writer :java_field_name [, :name_to_expose_as]
field_attr_accessor :java_field_name [, :name_to_expose_as]

  This is pretty close to Ruby equivalent syntax and was very useful.
If the second parm is not provided the actual java field name is used.
  Comments to solicit:

1. Anyone have a better name to suggest for this?
2. Alternate syntax suggestions?

>From my perspective, I am not really excited about a bunch of "magic"
aliases to exposing a field since this is already an explicit
operation.  I prefer to provide the :name_to_expose_as as a way of
providing a nicer name if the java field name sucks.  Comments?

I plan on putting new methods for handling fields in 1.1.5, so make
sure your voice is heard if you want something different.

-Tom

-- 
Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: [EMAIL PROTECTED] , [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to