Rob Speer on 4 Apr 2003 19:22:01 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[spoon-discuss] About Glotmorf's OO rule


I think that object-orientedness is exactly what we need to put some
sanity back into the ruleset. However, Glotmorf's proposal doesn't go
about it very well.

It doesn't make distinctions between classes and instances well enough,
given the number of things that say "2GC or 2GO". Classes should _not_
have the characteristics that their instances have, except in a
different sense of 'have'. With wording like this, I may be able to
squeeze the Gnome class as easily as I could squeeze a Gnome.

Too much is included in the rule, as well, when those things could be
fundamental properties of a very general class. The rule describes an OO
system without itself being OO.

I don't get Collection Properties or Pointer Properties. _Especially_
Pointer Properties. It does give me an image of the Nomic following a
null pointer and segfaulting, though. Anyway, a Collection should just
be its own kind of object. (I call it a List or a Set.)

"Properties" also doesn't seem to encompass the things that I think of
as properties - descriptions of things that are true of every instance
of the class. I suppose that in this proposal, those things have to be
separated out into the ruleset. These properties are really just
variables.

Anyway. Here's my idea for an OO system:

First, I'd make this rule.
{{
There exists a Class List, which describes the Classes that exist in the
game. Everything in the game is an instance of some Class. If not
otherwise specified, the thing is an instance of the Thingy class.
}}

That's all you need. Really.

Then, some classes to start with:

Class: Thingy
Inherits from: None
Properties:
  * follows the Rules
  * is an instance of a Class
  * has all of the properties of its Class and all Superclasses of its Class
  * can perform all of the actions of its Class and all Superclasses of its
    Class

Class: Concept
Inherits from: Thingy
Properties:

Class: Number
Inherits from: Concept
Properties: is a mathematical constant

[... Integer, NaturalNumber, PositiveNumber classes derive from it]

Class: List
Inherits from: Concept
Properties:
  * has any number of members, each of which is an Instance

Class: Set
Inherits from: List
  * all members are distinct

Class: OrderedList
Inherits from: List
Properties:
  * has a known Length (an instance of Integer)
  * every member is associated with an Index (an instance of Natural)
  * the Indices form a consecutive sequence of numbers, starting with 0

Class: Class
Inherits from: Unique
Properties:
  * inherits from one or more classes, unless it is named Thingy
  * has a list of Superclasses, which contains each Class that it inherits
    from, plus all the Superclasses of each of those Classes

Class: Object
Inherits from: Thingy
Properties:
  * has a name

Class: Unique
Inherits from: Object
Properties:
  * is the only instance of its class
  * cannot be destroyed
  * has a uniquely-identifying name

Class: Rule
Inherits from: Object
  * (properties of rules go here)

Class: Ruleset
Inherits from: Unique, Container
  * contains all Rules in existence, plus the ClassList

Class: ClassList
Inherits from: Unique, Container
  * contains the definitions of all Classes

... and so on. There's Entity which inherits from Thing; Corporation, Society,
and Person, which inherit from Entity; Player, from Person; Administrator, from
Person and Unique; etc.

I believe that most of the Ruleset could be converted into this form,
but these classes will also coexist with a mostly unchanged ruleset.

-- 
Rob Speer

_______________________________________________
spoon-discuss mailing list
spoon-discuss@xxxxxxxxx
http://lists.ellipsis.cx/mailman/listinfo/spoon-discuss