Re: Allowing property getters without a "get" prefix on DataObjects

David Feshbach <[email protected]>
Newsgroups gmane.comp.java.cayenne.devel
Message-ID <CALYNp62PCpT6C3eFxj8pHAMnWcRsgWQ-4JdvZP1-822Dy4jJnw@mail.gmail.com>
IIRC, EOF/Wonder allowed you to implement NSKeyValueCoding and the
Utilities class would call valueForKey instead of looking up methods/fields
via reflection. Something similar that would allow you to write/generate
your own readProperty method might work for Cayenne.

On Tue, Sep 25, 2018 at 3:28 PM Maik Musall <[email protected]> wrote:

>
>
> > Am 25.09.2018 um 16:59 schrieb John Huss <[email protected]>:
> >
> > On Tue, Sep 25, 2018 at 9:50 AM Maik Musall <[email protected]
> <mailto:[email protected]>> wrote:
> >
> >>
> >>
> >>> Am 25.09.2018 um 16:23 schrieb Andrus Adamchik <[email protected]
> >:
> >>>
> >>>> "Should Cayenne by default work without prefixed accessors".
> >>>
> >>>
> >>> So how about this... Unless someone else steps in by then, let me
> >> brainstorm it with Nikita a couple of weeks from now and see if we can
> do a
> >> DI solution. It is not nearly as involved as it appears.
> >>
> >> I would be very happy about that! :)
> >>
> >> And once that's there, one way to implement a BeanAccessor alternative
> >> could perhaps be one that is tailored towards field-based DataObjects,
> >> accessing the fields directly without using reflection? If possible,
> that
> >> could present another noticable performance win.
> >>
> >
> > FWIW, I would consider this a non-goal since it would bypass the getter
> > method which may have custom logic (like returning a default value or
> > something).
>
> I didn't mean this to become a standard way, but once the DI point is
> there,
> it's easy to rock your own implementation if you know it matches your use
> case.
>
> Maik
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.