Hi David

OOP is far too complicated.

I represent your data by a sorted file like this

0 animal
01 bird
02 reptile
021 snake
022 newt 
023 frog
03 mammal

031 deer
032 rabbit
033 squirrel
034 skunk
1 counts
123 1
134 1

Note that digit zero in the line number is a wildcard character. Zero padding 
to the right is allowed. 

Choosing a data structure is independent on choosing a programming language.
-Bo

--- Den tors 18/3/10 skrev David Ward Lambert <[email protected]>:

Fra: David Ward Lambert <[email protected]>
Emne: [Jprogramming] OOP in j
Til: [email protected]
Dato: torsdag 18. marts 2010 21.17

When I run my dog I count critters.  I can identify some of them.  And
so developed a taxonomy counter  in python.  Incrementing one of these
objects also  increments all those above  it.  Thus if we  find a frog
I'd increment the animal object;  on finding a skunk we'd go elsewhere
before incrementing "mammal".  Home again I'd read 2 animal, 1 mammal,
0 all else.   I suppose I used a registration  technique in the python
object initializer.  Solutions in j please?

The interface includes construct structure, modify any of the objects,
report correctly.


              animal

   bird       reptile         mammal
              /   \         /   |   \
            snake newt   deer rabbit squirrel


Related, has anyone written Design Patterns in j?  Thanks, Dave.


__________________________________________________
Bruger du Yahoo!?
Er du træt af spam?  Yahoo!Mail har den bedste spambeskyttelse, der findes 
http://dk.mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to