c# - OOD Media Lookup Application -
i playing around object oriented design/database design creating application can pull info various sources amazon or imdb keep info on movies/music/books have or have watched/read etc... product objects such movie, book, album etc.. composed of attributes 1 or more sources, overlap between different types of objects(eg products have title, asin name few). in addition, various sources have of same information(eg release date), , different information(for instance imdb contains more info on cast members may want use, while not pull info amazon). want able choose source these overlapping attributes from. see linked image simple example:
http://imageshack.us/photo/my-images/194/drawing1r.png/
it seems redefining attributes defined in parser classes in movie class bit redundant, , moreso if continue create other classes such book, album(redefining asin, imdbid etc...). seems approaching wrong.
any suggestions better design easier extend , maintain?
you create superclass called 'product' holds common properties between movie, book , albums. each of these particular object types inherit common parent class.
shouldn't amazon , imdb parsers create product objects? why hold properties of products? if parse each product individually, each product parses itself, , include code in each particular product class (or parent). each object should have function or represent object - parsers represent object or perform function (parsing) creates object?
you create common parent class each type of source, or interface (iproductsource) , call methods of interface, without particular objects knowing/caring actual data source behind interface.
Comments
Post a Comment