You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just added this to the README, but thought it might be worth mentioning here as well. When using the coerce() method of BeanAdapter, there are a few distinctions between converting to an interface versus a concrete type (i.e. a class or record). Obviously, an interface is simpler to declare and thus easier to maintain. On the other hand, since it is implemented by a dynamic proxy and backed by a map, it will most likely be slightly less efficient.
However, an important functional distinction is that concrete types are coerced "eagerly" (before coerce() returns), while interfaces are coerced "lazily" (when a property is accessed). Depending on use case, this may make one option or the other more compelling or applicable.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I just added this to the README, but thought it might be worth mentioning here as well. When using the
coerce()method ofBeanAdapter, there are a few distinctions between converting to an interface versus a concrete type (i.e. a class or record). Obviously, an interface is simpler to declare and thus easier to maintain. On the other hand, since it is implemented by a dynamic proxy and backed by a map, it will most likely be slightly less efficient.However, an important functional distinction is that concrete types are coerced "eagerly" (before
coerce()returns), while interfaces are coerced "lazily" (when a property is accessed). Depending on use case, this may make one option or the other more compelling or applicable.Beta Was this translation helpful? Give feedback.
All reactions