...
A
...
small
...
collection
...
of
...
ideas
...
for
...
MOP
...
2
...
ideas
...
by
...
Jochen:
...
- we
...
- should
...
- no
...
- longer
...
- directly
...
- invoke
...
- methods
...
- like
...
- equals,
...
- setProperty
...
- and
...
- such.(see
...
- GROOVY-2635
...
- for
...
- example)
...
- we
...
- should
...
- think
...
- about
...
- changing
...
- GroovyObject
...
- into
...
- a
...
- pure
...
- marker
...
- interface
...
- (if
...
- setProperty
...
- is
...
- needed
...
- in
...
- the
...
- logic
...
- we
...
- have
...
- problems)
...
- the
...
- MetaClass
...
- should
...
- be
...
- able
...
- to
...
- overwrite
...
- all
...
- methods
...
- including
...
- setProperty
...
- (this
...
- implies
...
- that
...
- we
...
- do
...
- not
...
- directly
...
- call
...
- setProperty)
...
- Comparable
...
- needs
...
- a
...
- rethought.
...
- This
...
- interface
...
- is
...
- not
...
- well
...
- to
...
- be
...
- used
...
- if
...
- you
...
- have
...
- to
...
- handle
...
- objects
...
- of
...
- different
...
- types
...
- it
...
- would
...
- be
...
- nice
...
- to
...
- be
...
- able
...
- to
...
- define
...
- only
...
- one
...
- operand
...
- like
...
- <
...
- or
...
- >
...
- instead
...
- of
...
- having
...
- to
...
- define
...
- both.
...
- At
...
- last
...
- being
...
- able
...
- to
...
- define
...
- these
...
- additionally
...
- we
...
- have
...
- to
...
- test
...
- if
...
- creating
...
- direct
...
- method
...
- call
...
- classes
...
- in
...
- call
...
- sites
...
- is
...
- doable.
...
- This
...
- would
...
- be
...
- like
...
- Reflector,
...
- but
...
- only
...
- for
...
- a
...
- single
...
- method,
...
- allowing
...
- the
...
- JIT
...
- to
...
- inline
...
- the
...
- method
...
- without
...
- much
...
- hazzle.
...
- currently
...
- reflection
...
- means
...
- to
...
- have
...
- a
...
- border
...
- where
...
- the
...
- JIT
...
- can
...
- not
...
- really
...
- inline
...
- the
...
- call.
...
- Maybe
...
- we
...
- should
...
- also
...
- have
...
- different
...
- modes
...
- here,
...
- to
...
- allow
...
- users
...
- to
...
- still
...
- use
...
- reflection
...
- if
...
- this
...
- version
...
- has
...
- a
...
- problem
...
- on
...
- certain
...
- VMs
...
- or
...
- in
...
- certain
...
- scenarios
...
- as
...
- a
...
- design
...
- goal
...
- I
...
- would
...
- like
...
- to
...
- transform
...
- the
...
- MetaClass
...
- from
...
- a
...
- directly
...
- method
...
- invoking
...
- to
...
- a
...
- request
...
- oriented
...
- method
...
- returning
...
- class.
...
- This
...
- would
...
- be
...
- especially
...
- interesting
...
- for
...
- call
...
- site
...
- caching.
...
- The
...
- user
...
- could
...
- still
...
- write
...
- his
...
- invokeMethod
...
- method,
...
- but
...
- instead
...
- of
...
- calling
...
- that
...
- method
...
- directly
...
- in
...
- the
...
- Metaclass
...
- we
...
- would
...
- let
...
- the
...
- MetaClass
...
- return
...
- a
...
- method
...
- wrapper
...
- that
...
- can
...
- do
...
- the
...
- call
...
- to
...
- invokeMethod.
...
- I
...
- would
...
- also
...
- like
...
- to
...
- add
...
- a
...
- Listener
...
- to
...
- each
...
- MetaClass
...
- which
...
- allows
...
- other
...
- parts
...
- of
...
- the
...
- program
...
- to
...
- be
...
- informed
...
- when
...
- a
...
- MetaClass
...
- is
...
- changed
...
- in
...
- any
...
- kind.
...
- This
...
- could
...
- probably
...
- also
...
- be
...
- used
...
- to
...
- invalidate
...
- call
...
- site
...
- caches.
...
- A
...
- version
...
- information
...
- added
...
- to
...
- the
...
- MetaClass
...
- allows
...
- a
...
- very
...
- fast
...
- check
...
- for
...
- changes.
...
- We
...
- could
...
- also
...
- think
...
- about
...
- adding
...
- an
...
- additional
...
- version
...
- cache
...
- for
...
- method
...
- names.
...
- the
...
- idea
...
- here
...
- is
...
- to
...
- have
...
- a
...
- simple
...
- array
...
- and
...
- to
...
- let
...
- a
...
- call
...
- site
...
- cache
...
- the
...
- index
...
- to
...
- the
...
- array,
...
- which
...
- means
...
- the
...
- index
...
- is
...
- equal
...
- to
...
- a
...
- complete
...
- method
...
- signature
...
- or
...
- only
...
- to
...
- name.
...
- By
...
- checking
...
- the
...
- information
...
- in
...
- there(for
...
- example
...
- an
...
- referential
...
- identity
...
- check
...
- with
...
- the
...
- cached
...
- method)
...
- would
...
- allow
...
- the
...
- call
...
- site
...
- to
...
- quickly
...
- know
...
- if
...
- it
...
- needs
...
- to
...
- update
...
- or
...
- not.
...
- Such
...
- an
...
- array
...
- would
...
- grow
...
- other
...
- time
...
- if
...
- it
...
- needs
...
- to
...
- reflect
...
- dynamically
...
- added
...
- methods
...
- as
...
- well.
...
- So
...
- we
...
- should
...
- do
...
- this
...
- maybe
...
- only
...
- for
...
- the
...
- default
...
- methods.
...
- another
...
- design
...
- goal
...
- should
...
- be
...
- that
...
- if
...
- a
...
- code
...
- modifies
...
- a
...
- Metaclass,
...
- then
...
- as
...
- much
...
- changes
...
- as
...
- possible
...
- should
...
- be
...
- done
...
- by
...
- the
...
- thread
...
- modifying
...
- the
...
- metaclass.
...
- that
...
- means
...
- that
...
- this
...
- thread
...
- will
...
- for
...
- example
...
- call
...
- all
...
- the
...
- listeners,
...
- probably
...
- update
...
- caches,
...
- reorganize
...
- structures..
...
- what
...
- ever
...
- The
...
- allow
...
- call
...
- sites
...
- faster
...
- access
...
- without
...
- going
...
- through
...
- the
...
- registry
...
- it
...
- would
...
- be
...
- good
...
- to
...
- have
...
- some
...
- kind
...
- of
...
- handle
...
- that
...
- can
...
- be
...
- used
...
- to
...
- directly
...
- access
...
- the
...
- MetaClass.
...
- This
...
- means
...
- that
...
- either
...
- the
...
- real
...
- MetaClass
...
- must
...
- not
...
- be
...
- replaced
...
- (only
...
- on
...
- the
...
- implementation
...
- side
...
- of
...
- course)
...
- or
...
- that
...
- the
...
- handle
...
- is
...
- update
...
- if
...
- a
...
- replacement
...
- happens.
...
- I
...
- would
...
- also
...
- like
...
- to
...
- add
...
- a
...
- module
...
- concept
...
- based
...
- on
...
- different
...
- meta
...
- class
...
- registries.
...
- For
...
- this
...
- a
...
- class
...
- using
...
- a
...
- module
...
- will
...
- contain
...
- some
...
- kind
...
- of
...
- information
...
- that
...
- will
...
- cause
...
- all
...
- code
...
- directly
...
- in
...
- this
...
- class
...
- to
...
- use
...
- only
...
- the
...
- meta
...
- classes
...
- from
...
- the
...
- registry
...
- and
...
- probably
...
- no
...
- per
...
- instance
...
- meta
...
- class.
...
- As
...
- some
...
- kind
...
- of
...
- namespace
...
- is
...
- required
...
- to
...
- differentiate
...
- one
...
- module
...
- from
...
- another
...
- we
...
- could
...
- couple
...
- this
...
- with
...
- the
...
- package
...
- "package
...
- foo
...
- with
...
- module"
...
- or
...
- by
...
- using
...
- a
...
- package
...
- like
...
- reference
...
- to
...
- a
...
- constant
...
- "module
...
- Foo.myRegistry"
...
- (Foo
...
- is
...
- a
...
- normal
...
- class,
...
- myRegistry
...
- is
...
- a
...
- final
...
-
public
...
- static
...
- field
...
- of
...
- type
...
- MetaClassRegistry
...
- or
...
- an
...