The best advice I can give you here, is one I have read on Sandy Metz 
book(http://www.amazon.co.uk/Practical-Object-Oriented-Design-Ruby-Primer/dp/B00D81W074%3FSubscriptionId%3DAKIAILSHYYTFIVPWUY6Q%26tag%3Dduc08-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00D81W074):

You won't know what kind of fields all notifications will have in common 
until you implement them all. 

First you should implement all the concrete classes for every notification 
and then if there is many fields/methods that all of them have in common, 
you can create a concern or base notification class. 

It's much easier to refactor from all the concrete to an abstract class, 
then start from a guess abstract class and then refactor to concrete ones. 
For example, if you defined a base class notification with 3 fields: 
user_id, type and value. And after you defined 5 notifications, you would 
realise a new one does not need value. And imagine value is used in 3 
different methods. Removing this could be a pain to all the other 4 
"sub-classes".

So def start by implementing concrete with a good test base and then it 
will be much easier to refactor to an abstract class.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/7cd5e8be-493c-4385-ae20-3b16993225bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to