Make is more OOPey - good structure?
Posted
by
Tom
on Stack Overflow
See other posts from Stack Overflow
or by Tom
Published on 2011-01-01T16:37:51Z
Indexed on
2011/01/01
16:53 UTC
Read the original article
Hit count: 414
Hi, I just want advice on whether I could improve structure around a particular class which handles all disk access functions
The structure of my program is that I have a class called Disk which gets data from flatfiles and databases on a, you guessed it, hard disk drive. I have functions like
LoadTextFileToStringList, WriteStringToTextFile, DeleteLineInTextFile etc
which are kind of "generic methods"
In the same class I also have some more specific methods such as GetXFromDisk where X might be a particular field in a database table/query.
Should I separate out the generic methods from the specialised. Should I make another class which inherits the generic methods. At the moment my class is static as there is no need to have an internal state of the class.
I'm not really OOPing am I?
Thanks Thomas
© Stack Overflow or respective owner