hehehe, I completely agree about this. Several AR:B methods have 'quiet' formal parameters. for instance, 'inside', save accepts a parameter, if you override save, don't KNOW about the parameter, some of the internal uses of save will attempt to use this parameter and all of a sudden, you have broked it.
On 19 Jul 2013, at 19:52, Paul Robinson <[email protected]> wrote: > On 18 Jul 2013, at 15:18, Sean Bamforth <[email protected]> wrote: > >> What I find interesting in the Active* objects is that there's a tendency >> not to subclass methods. Instead, people will assign container class methods >> to event properties. I suspect it's because some languages don't allow you >> to subclass methods in an object definition, and people are used to coding >> against that. > > > > There are a few downsides to overriding methods that might play a part in > that. If you think about DRY and you think about how Rails is > developed/maintained, you can kind of see the danger: I over-ride this method > in a subclass, I commit and push and walk away. Three months later the parent > method is changed, and now my subclass's method is calling super and getting > something different back, or it's failing because the method signature has > changed, or might not even get invoked at all because the method signature > has changed(!). > > So in essence by over-riding the method, you're abandoning DRY because you > now have to have a parallel set of tests that make sure your method is > called, it behaves as expected and fails when bigger changes happen in the > parent class. > > I'm not saying you're wrong - I think over-riding is incredibly powerful - > just that I can see where the Rails team might have gone with that and > decided to back away from it. > > But then lots of the Rails source code looks odd to me for other reasons, and > I don't know why that's the case, so maybe it's just me... :-) > > -- > You received this message because you are subscribed to the Google Groups > "NWRUG" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/nwrug-members. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "NWRUG" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nwrug-members. For more options, visit https://groups.google.com/groups/opt_out.
