miho / VMF

VMF is a Lightweight Modeling Framework for the Java Platform (works on JDK 11-22)
Apache License 2.0
19 stars 5 forks source link

Add delegations to reflection API and optionally allow to configure delegation at runtime #18

Open miho opened 5 years ago

miho commented 5 years ago

Some ideas on how the API could look like:

A a = a.newInstance();

a.vmf().reflect().methods();

Method m;

m.getName()
m.getReturnType()
m.getArgumentTypes()
m.invoke(Object... args)

a.vmf().reflect().behavior().set(myDelegate)
myDelegate = a.vmf().reflect().behavior().get()

m.behavior().set(myDelegate)
myDelegate = m.behavior().get()

How do we represent static vs. non-static behavior/delegation?