🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.objective-c
1 messages
1 total messages Started by Tim Olson Thu, 09 Apr 1992 19:12
Information hiding problem
#19
Author: Tim Olson
Date: Thu, 09 Apr 1992 19:12
41 lines
1720 bytes
I've written a number of small Objective-C programs using the NeXT
appkit, but recently I tried a larger project that doesn't just
mainly use appkit objects.  I encountered a problem with information
hiding, and I was wondering what the best way around it was.  I think
that the basic problem is that the interface specification is used in
two different ways: 

	1) To define new methods that the object responds to, so that other
	   objects which call it can know the correct types to use for
	   method parameters and return values (prototypes).

	2) To define all object data which is "global" to the object (shared
	   by all methods), to allow for subclassing.

The two different uses seem to coexist ok when working with simple
data types, but consider an object implementation which uses a
structure, enum, or typedef (i.e.: 

---
#import <objc/Object.h>

enum State {Idle, Waiting, Running};

@interface MyObject: Object {
	enum State state;
	.
	.
};
---

When this interface file is included in another object's .m file to
define the messages, the enum declaration seems to behave with "file
scope", no matter where it appears in the file (before or after the
@interface declaration). 

Are there standard ways around this?

--
	Tim Olson
	Advanced Micro Devices
	tim@amd.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads