IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New It basically means
..that you write a parent class from which the actual storage mechanisms will inherit. IOW, you write an interface and set that in stone. Then you write a tool which implements that interface, whether that be XML, flat-file, database, what-have-you. If someone else wants to implement the same set of operations with a pickle storage mechanism, they are welcome to do so. The rest of your program only needs to know that, when it's time to save state to disk, it calls childclass.saveGame() or equivalents. Since each possible way-of-saving uses the same interface (i.e. - the same set of methods and properties, which they inherit and override from the parent class), the rest of your program doesn't need to care which storage mechanism is used. This is a common design pattern, and allows you to:

1) Write the rest of your program without forcing it to "know" how data is stored,
2) Have multiple storage mechanisms in the same application,
3) Solicit multiple mechanisms from multiple programmers, at various times in the project lifecycle (even after it's released),
4) Write temporary classes which allow you to test the functionality of other parts of the app before you've finished coding the storage mechanism,
5) I could go on and on. I'll stop now.

In the design of an application, whenever you ask yourself, "which way should I implement this?", the first answer that comes to your mind should be, "all ways". Then you can pare down from there. :)

Many fears are born of stupidity and ignorance -
Which you should be feeding with rumour and generalisation.
BOfH, 2002 "Episode" 10
New On the other hand...
"Do the simplest thing that works."

If you end up with more framework code than instance code, you've wasted your time. If you end up with only one way of saving things because it's sufficient, then you've wasted your time. If you get all the way through your framework implementation, and then when it's time to do a second instance implementation you discover that your frameork is too inflexible to add a second instance easily, then you've wasted your time.

I don't usually generalize something until the second or third time I do the same kind of functionality.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New On the gripping hand:
If the interface will be simple enough to get right the first time, go ahead and build it.

Here's an article on the factory pattern:

[link|http://www.developer.com/tech/article.php/626161|http://www.developer...rticle.php/626161]
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New True
I don't usually generalize something until the second or third time I do the same kind of functionality.


I usually don't either, especially for new territory. But I've abstracted state-saving mechanisms often enough that it's now second-nature, and I can't imagine doing a project without it. :) Thanks for the link on the factory pattern.


Many fears are born of stupidity and ignorance -
Which you should be feeding with rumour and generalisation.
BOfH, 2002 "Episode" 10
     External data philosophy - (inthane-chan) - (15)
         Some points to consider: - (admin) - (14)
             The data needs to be human readable/writeable. - (inthane-chan) - (13)
                 Use XML then. - (admin) - (6)
                     Damn, it's a reeses commercial! - (inthane-chan) - (2)
                         Anywhere you can run gcc - with a caveat: - (admin) - (1)
                             Re: Anywhere you can run gcc - with a caveat: - (deSitter)
                     PyObjC - (tuberculosis) - (2)
                         plist parsers... - (admin) - (1)
                             Re: plist parsers... - (tuberculosis)
                 First co-op project? - (tseliot) - (5)
                     (Which will be great when I grok WTF that means... ;-) ) -NT - (inthane-chan) - (4)
                         It basically means - (tseliot) - (3)
                             On the other hand... - (admin) - (2)
                                 On the gripping hand: - (admin)
                                 True - (tseliot)

I Palindrome I.
85 ms