Strategy Pattern Q
Hi,
I've been reading about the Strategy Pattern and I would liek to implement into one of my own small projects.
I have an application called WatchDog, this application checks some directories (provided as parameter) and puts every item in a directory in an appropriate mysql table.
I have this section in my code:
privatevoid insertFile(File aFile, String arg){
if (arg.equals("/EBooks"))
qry.InsertEbook(aFile);
elseif (arg.equals("/MP3"))
qry.insertMP3(aFile);
elseif (arg.equals("/Videos"))
qry.insertVideo(aFile);
}
this looks like a perfect candidate for Strategy Pattern to me?
But I'm struggling with the design.
The concept is an insert query, or simpler a query right?
The strategy interface is DataType (EBooks, MP3, Videos, ...)
And Ebook, MP3, Video are ConcreteStrategy classes then?
Can anybody give some clarification on this one pls?
grtz

