Hey, check this out


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]

Posted by Alan Fong on July 12, 2001 at 22:00:21:

Either I've gone insane, or I actually understand something!

remember how the professor was like, dont create a foo until you need it? and we're like, how is that?

REQUEST_RESULT create_foo(unsigned char process_id, unsigned long int initializer, unsigned long int & references)

ok, that doesn't fit neatly on one line, but essentially its a:

process_id
initializer
references

now if you notice, none of those were the mysterious foos that DVW talks about. they are the ingredients. most of us were going to combine the ingredients into the foo class, and get some weird foo cake. then we were going to store the weird foo cake in a tree, or linked list, or something. Making this foo cake was what DVW was talking about taking a long time.

Now, please bear with me. Sometimes people order a foo cake, but they never pick it up. It wastes our time, and takes up space. Now, foo cakes are different. think of the seed values, i mentioned above as like:

strawberry, banana, chocolate.

ok. that was off the topic.

lets say, Natalie wants a foo cake. say she wants spam flavored foo cake. when we take the order, instead of making it right away, we just write her name down, and what flavor, spam, and where were going to put it when we make it. Natalie might not come back to pick it up, so instead of making the cake, we write down:

Natalie, spam, shelf slot 1

corresponding to who asked for it, what flavor it is, and where on the shelf were going to put it if we make it. then we store that in the tree, array, linked list, etc

if and when Natalie appears, well pull out the piece of paper, and make her a spam cake, the sicko. so we only make it if she comes back to claim it.

now foo cake has strange and mysterious properties. if you make a foo cake, you can cut as many slices of it as you want. Foo cake is infinite. So if say, Marina, wanted some spam cake, we wouldnt need to make a whole new spam cake, we just cut her some from the one we made for Natalie. The address is also important cause we wouldnt want to give her the wrong cake.

And deleting the cake means you cant cut anymore slices from it. so if someone asks for it again, you got to make it again.

um, if you can see through this thick metaphor, i think it should be a little helpful.

Im going to eat some cake now.

Later

Alan



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]