Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Luther Baker
On Wed, Mar 19, 2014 at 12:14 AM, Sixten Otto hims...@sfko.com wrote: On Tue, Mar 18, 2014 at 7:29 PM, Luther Baker lutherba...@gmail.com wrote: A _better_ analogy to an Objective-C @protocol would be a formal Java interface. Sure. And the same in C# (which the OP was asking about).

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Luther Baker
And more to the point, I think the original poster already knows what you are saying. I think he is asking for thoughts regarding his approach to simulating a notional Abstract Class via mix of @protocols and @classes in Objective-C. He clearly knows he can't do it with @protocols alone. and

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Sixten Otto
On Wed, Mar 19, 2014 at 12:38 AM, Luther Baker lutherba...@gmail.comwrote: On Wed, Mar 19, 2014 at 12:14 AM, Sixten Otto hims...@sfko.com wrote: The significant difference, though, between an abstract class in Java or C#, and a protocol in Objective-C, is that the former may have substantial

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Sixten Otto
On Tue, Mar 18, 2014 at 5:30 PM, William Squires wsqui...@satx.rr.comwrote: My best guess is to: 1) Make an ObjC class, and have it implement those methods that subclasses don't have to override. For those the subclasses must override, implement a stub that raises an exception if a message

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Jens Alfke
On Mar 19, 2014, at 7:32 AM, Sixten Otto hims...@sfko.com wrote: (I'm hard pressed to think of much use for such a pure abstract class, though; what could you do with such a thing that couldn't be done with interfaces.) Pure abstract class is a C++ term. It's the C++ equivalent of an

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread William Squires
On Mar 18, 2014, at 9:29 PM, Luther Baker lutherba...@gmail.com wrote: On Tue, Mar 18, 2014 at 8:11 PM, Kyle Sluder k...@ksluder.com wrote: On Tue, Mar 18, 2014, at 05:30 PM, William Squires wrote: Hi all! Obviously (IIRC) a pure abstract class would map to a formal protocol in ObjC

Re: VC# vs. ObjC and partial abstract classes

2014-03-19 Thread Maxthon Chan
You can emulate this behaviour somehow by not implementing the methods that is abstract, and prevent instantiation by introspecting and throwing exceptions in -init;. Definitely non-trivial but works. On Mar 19, 2014, at 23:43, William Squires wsqui...@satx.rr.com wrote: On Mar 18, 2014, at

VC# vs. ObjC and partial abstract classes

2014-03-18 Thread William Squires
Hi all! Some languages (like C++ and Visual C#) allow for partial abstract classes (i.e. some methods are implemented, while others are left to subclasses to implement - and, in fact, must implement since the partial abstract class does not). Is there a way to do this in ObjC? Is this why

Re: VC# vs. ObjC and partial abstract classes

2014-03-18 Thread Kyle Sluder
On Tue, Mar 18, 2014, at 05:30 PM, William Squires wrote: Hi all! Some languages (like C++ and Visual C#) allow for partial abstract classes (i.e. some methods are implemented, while others are left to subclasses to implement - and, in fact, must implement since the partial abstract

Re: VC# vs. ObjC and partial abstract classes

2014-03-18 Thread Luther Baker
On Tue, Mar 18, 2014 at 8:11 PM, Kyle Sluder k...@ksluder.com wrote: On Tue, Mar 18, 2014, at 05:30 PM, William Squires wrote: Hi all! Obviously (IIRC) a pure abstract class would map to a formal protocol in ObjC (or a class interface in languages such as REALbasic/Xojo, or VB 6).

Re: VC# vs. ObjC and partial abstract classes

2014-03-18 Thread Chris Hanson
On Mar 18, 2014, at 7:29 PM, Luther Baker lutherba...@gmail.com wrote: A _better_ analogy to an Objective-C @protocol would be a formal Java interface. In their design, Java’s interfaces were explicitly modeled on Objective-C’s @protocol construct. -- Chris

Re: VC# vs. ObjC and partial abstract classes

2014-03-18 Thread Sixten Otto
On Tue, Mar 18, 2014 at 7:29 PM, Luther Baker lutherba...@gmail.com wrote: A _better_ analogy to an Objective-C @protocol would be a formal Java interface. Sure. And the same in C# (which the OP was asking about). So, Kyle may have good reasons for his answer - but if I understand the