From: Erik V. <eri...@xs...> - 2012-06-11 19:20:43
|
Stefan, Strange things sometimes happen: your response ended up in my junk mail, and I just found it. I sent my question off-list because I was just curious about the reason why you renamed Round to AbstractRound. I had intended to reserve expressing my dislike of that change for a follow-up, if still relevant at all. But you guessed it. I don't see why the fact that a superclass is abstract should be expressed in its name. If a developer working on a subclass forgets that, he'll find out soon enough. But it's probably just a matter of taste - as always. On interfaces: I don't like the 'I' postfix either. When we started Rails, some people gave their well-meant advices, and I did not have much background in Java design, so I went ahead as they told me. But here I am on your side. All or most 'I' interfaces we have are useless (in fact: annoying), and if you want to get rid of these, you have my full support. Erik. > -----Original Message----- > From: Stefan Frey [mailto:ste...@we...] > Sent: Monday, May 28, 2012 5:14 PM > To: Erik Vos > Subject: Re: [Rails-devel] Updated rails 2.0 branch > > Follow-up: > I do not mind to make such discussions on-list, as this can help to generate a > list of coding standards for Rails. > But that is up to you to decide (I did not even imagined to be this off-list, but > I wondered why it did not came back from the list ...) Stefan > > > Erik: > Rails2.0 should not be "my" project, even if I am the driving force > behind the refactoring. > > Good to see your comments: > > Naming is convention, and mostly a matter of taste. First of all I do > not like the postfix -I convention. > > My preference for Interface names are to either use adjectives, for > example Ownable, Observable etc. > > If I realize that most classes that are derived from an Interface uses > the same base implementation I use an abstract Class and prefer a short > noun like State, Model etc. > > If I do not come up with a good adjective for the Interface I use a > short noun there (like Item instead of "Itemizeable" or "Roundable") and > if I now add a baseline abstract class I prefix with Abstract (e.g. > AbstractItem and AbstractRound). > > However if every class that implements the Interface is derived from the > abstract class there is no need to keep the Interface and I drop it, as > it is easy to factor it out again later on - if needed. > > I could have removed the Round interface altogether and rename > AbstractRound to Round again, but I did not focus on that so far, as I > intend to change the Round mechanism anyway. > > But if you prefer to keep at least RoundI as historical artifact, this > is possible. > > Stefan |