mikechau / tw-sales-tax-draft

Problem #2: Sales Tax
0 stars 2 forks source link

Think about making an Item class #3

Open ghost opened 11 years ago

ghost commented 11 years ago

Feel free to discuss with me here ;)

mikechau commented 11 years ago

Hmm.. trying to think about how I would use it. I suppose it makes sense to have a item class and then use inheritance with it. Trying to think about how it would fit in the 3 pillars I started with: input, calculator, print.

ghost commented 11 years ago

Right now you have computational classes - models that are intended to do something - but there are other types of models, too. For example, in a standard Rails model, an Item would be a standard model, right? You can use it just like a Rails model (minus persisting to the db).

ghost commented 11 years ago

Actually, now that I'm thinking about it, you might be able to rearchitect around Items and Lists, which would have Calculate, Print, and Input as modules or methods. I think modeling around computation isn't that common.