From: Srijayanth Sridhar Date: 2009-05-06T22:04:48+09:00 Subject: Design question --001e680f149898f30804693e0953 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I am building a simple tool to help with some statistical analysis of a sports site. I have the following: class Player # just a wrapper around ostruct for read_only access class Team # a collection of players class League # a collection of teams There are many ways I can "build" the league so to speak. I want to be able to build the league from a web site(scraping for information), from a DB(for local access) and a file(for even more local access I suppose). Now I am having a bit of a problem organizing a few things. Should I have an abstract class Builder and derive WebBuilder, DBBuilder, and FileBuilder from it or should I just have different methods within the league class? If I were to make these separate classes, then the builder class will have to somehow get the data back across to the League class which actually builds the team. It feels a bit kludgy. I don't want to burden the Team and Player's constructors with any more than just basic assignments. Is this a bad idea? And the bigger fish here is the web builder. The web builder has to screen scrape a site with a list of teams, from which it goes to each team page, and further fetches statistics by going to the player's site. Its really elementary to do, but again, where should it ideally fit? Thank you, Jayanth --001e680f149898f30804693e0953--