• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: EOEnterpriseObjectClazz with interface
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOEnterpriseObjectClazz with interface


  • Subject: Re: EOEnterpriseObjectClazz with interface
  • From: Johann Werner <email@hidden>
  • Date: Tue, 20 Nov 2018 10:39:15 +0100

Hi Mark,

I think you have to tell us what exactly you want to achieve? Do you have an
example?

With the EOEnterpriseObjectClazz you have a static instance within your class
but this instance is… an instance so you could put an „implements interface“ on
it. Or if you just want to know if class A has a static clazz object you could
create some empty interface (IHasClazzObject) as marker.

jw


> Am 19.11.2018 um 22:12 schrieb Morris, Mark <email@hidden>:
>
> Hallo Johann,
>
> Thanks for the info. I do see how I could create a default implementation of
> the “static” method I’m expecting in our local EO superclass’s util inner
> class, and from then on know that it will be legal to call it from any of our
> subclasses. So that could work in this case.
>
> In general though I still don’t see how, or if it’s even possible, to do what
> I was originally trying with the interface. For instance methods, I can just
> test “myClass instanceof myInterface” and know whether that class implements
> the methods. In ObjC, I could do the same with a protocol, but with instance
> and class methods. It seems like the description of the clazz paradigm is
> saying it makes that possible, but I’m just not understanding how that works.
>
> Thanks again. Tschüß!
> Mark
>
> From: Johann Werner <email@hidden>
> Date: Monday, November 19, 2018 at 1:37 AM
> To: "Morris, Mark" <email@hidden>
> Cc: "email@hidden" <email@hidden>
> Subject: Re: EOEnterpriseObjectClazz with interface
>
> Hi Mark,
>
> have a look at BugTracker and its dependent framework BTBusinessLogic. That
> should you give some ideas. There are some more apps/frameworks in Wonder
> using that pattern, just have a look at the type hierarchy of the
> EOEnterpriseObjectClazz class (in Eclipse right click on the class name and
> select „Open Type Hierarchy“ from the context menu).
>
> jw
>
>
> Am 19.11.2018 um 06:31 schrieb Morris, Mark <email@hidden
> <mailto:email@hidden>>:
>
> Hi all,
>
> I ran into a simple case where a good old ObjC protocol would have worked
> fine, but Java provides only frustration. 😉
>
> I wanted to require that a class that decides to implement a particular
> interface should as part of that interface implement a certain static method.
> No go in Java.
>
> The implementing classes will always be subclasses of ERXGenericRecord, and a
> little searching uncovered the promising EOEnterpriseObjectsClazz approach.
> Right at the top it says:
>
> In Java, static methods are similar to class methods in Objective-C, but one
> cannot use static methods in interfaces and static methods cannot be
> overridden by a subclass. Using the clazz pattern removes those limitations.
>
> However, I didn’t see any examples of this use, and spent a little time but
> couldn’t figure it out. Are there any examples out there?
>
> Thanks!
> Mark

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: EOEnterpriseObjectClazz with interface
      • From: "Morris, Mark" <email@hidden>
References: 
 >EOEnterpriseObjectClazz with interface (From: "Morris, Mark" <email@hidden>)
 >Re: EOEnterpriseObjectClazz with interface (From: Johann Werner <email@hidden>)
 >Re: EOEnterpriseObjectClazz with interface (From: "Morris, Mark" <email@hidden>)

  • Prev by Date: Re: EOEnterpriseObjectClazz with interface
  • Next by Date: Re: EOEnterpriseObjectClazz with interface
  • Previous by thread: Re: EOEnterpriseObjectClazz with interface
  • Next by thread: Re: EOEnterpriseObjectClazz with interface
  • Index(es):
    • Date
    • Thread