-->

Friday, May 11, 2007

Genesis

Stardate 60051.1
This morning I was in the half awake, half asleep state, and this was going through my head:

public class Genesis
{
Universe universe = new Universe(new Heaven(), new Earth())
}

I don't know why this came up I have not read the Bible in a while, and not Issac Asimov's "The Last Question" in some time. I kept processing it in the shower. Should I use enumerated constants for the six days? Nah, it's a one time execution, just use a for loop. What are the operations? Separate night from day, earth from sea, etc?

May 5th was the first Friday of the month, which means free dress, no uniforms. Thursday was also free dress (for a dollar fund raiser). One of the problems with wearing uniforms is that when they don't have to, they don't know what to wear, more or less. What's even stranger is th my pre-teen daughter is pretty quick about choosing clothes, but my two boys can't decide. Growing up, I remember just grabbing what was on top of the dresser drawer. Thomas is just lazy. He got mad at me because I would not let him wear the same set of clothes for three days in a row. The I added insult to injury by making him take a jacket. Patrick now does not not want to wear anything with printing, which eliminates most everything.

End of Entry

7 comments:

Matthew O. Smith said...

This looks like a job for IoC.

interface CelestialBody {
public void add(CelestialBody ch);
public void applyTime(CelestialMechanics mc);
}

class Universe implements CelestialBody {}

class Heaven implements CelestialBody {}

class Earth implements CelestialBody {}

universe.add(new Heaven());
universe.add(new Earth());

Each CelestialBody can be made up of one or more celestial bodies. Also, time is applied a given body. Thus, Earth can exist and then have the time divided later into night and day.

This supports the notion that there will be a new Heaven and a new Earth with a simple replace. Of course the old heaven and earth will be eligible for garbage collection.

Not Yet Dead said...

Design Patterns for Creationists... interesting notion. Inversion of Control would be a difficult concept for the worshipers of the Supreme Being using it.

The old heaven and earth may be eligible for garbage collection, but may not be if the Universe uses strong references. Which means many heavens and earths may exist, but are unreachable, and the universe expands as each new one is instantiated. If weak references are used, then the size of the universes container can be an absolute maximum.

An interesting question comes to mind. Does the concept of Armageddon imply the use of deterministic destructors?

Not Yet Dead said...

Or might it just be a finalizer?

Matthew O. Smith said...

Actually I messed up. Earth and Heaven might need to be interfaces because the new heaven and earth may not be the same as the old one.

It appears that each CelestialBody will need a handle or name if your will. Once the Earth is created and placed in the universe, it will need to be references so you can either remove, replace or apply Armageddon to it.

I am thinking the Universe uses weak references. It can still be infinitely large, but once a object in the Universe is destroyed or changed, the Universe should not keep a reference to the old one around. The Universe gives organization to object, but their life cycle is independent of the Universe in which they exist.

Not Yet Dead said...

Actually, thinking over the 'specification' (which has had multiple authors and revisions); it calls for one heaven and one earth. Leaving it open to add, update, or remove CelestialBody allows for all sorts of out of scope changes. Pretty soon we will have planets, asteroids, black holes, etc. Then those will be sub-categorized into such things as dwarf planets. Heaven and Earth are singletons, and should have only one instance per Universe.

utpoohbear said...

all I can say is "Huh?"

Not Yet Dead said...

Esoteric humor.