Up to Main Index                            Up to Journal for August, 2013

                   JOURNAL FOR WEDNESDAY 28TH AUGUST, 2013
______________________________________________________________________________

SUBJECT: More epiphany and just what is a location?
   DATE: Wed 28 Aug 22:38:42 BST 2013

Following on from my epiphany entry[1] I've noticed one thing that can be
tricky. When defining the interfaces not only should parameters be primitives
or interfaces but so should return types.

Otherwise - keeping our epiphany 'points' in mind - where does the type get
defined?

If it's defined in a non-interface package the interface package would have to
import it which is exactly what we are trying to avoid.

You could define it in the interface package but then any methods on the type
have to be defined in the same package. So now you end up with the interfaces
and non-interfaces mixed in the same package again.

For now I'm keeping things simple and just sticking to primitives and
interfaces for parameters and return types.

One other thing I noticed - which is what makes me think this is a much better
idea - I'm having to think more :) Think more in the sense that I need to
accurately name the interfaces which are a lot more specific now - which is
how it should be. Composing interfaces and types seems to be easier - but only
after you have worked out what something actually *IS*.

For example what is a 'thing' now? It's unique, nameable, aliasable,
describable, unmarshalable, marshalable and initialisable. Each of these being
simple interfaces.

What about a location? Well it's all of the above plus... Well what makes a
location a location? Exits? Does it have to have exits it be a location? A
location without exits is perfectly valid - you might only be able to enter or
exit the location by teleporting, portals or other magic.

I suppose a location could be defined as a thing with with an inventory that
has a capacity large enough for you to fit into. That gives us something that
is incredibly flexible. A location could be an actual room, a box - coffin? A
giant's backpack - novel idea for 'transport' - or a sleeping bag for example.
It could even be inside a coffee mug - providing you can find a way to reduce
your size to fit within the mug's capacity - or is it the giant's? ;)


    You are on the giant's table. There is a coffee mug here.
    > go mug
    You climb into the coffee mug.

    You are inside the giant's coffee mug the bottom of which is encrusted
    with sugar.
    > get sugar
    You manage to break off a chunk of sugar and take it.
    >


Enough fun... back to coding...

--
Diddymus

  [1] See entry for 22nd August 2013: 22.html


  Up to Main Index                            Up to Journal for August, 2013