Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I name an "umbrella" type sanely?

This has "always" bothered me...

Let's say I have an interface IFiddle and another interface that does nothing more than aggregate several distinct IFiddles:

public interface IFiddleFrobbler
{
    IFiddle Superior { get; }
    IFiddle Better { get; }
    IFiddle Ordinary { get; }
    IFiddle Worse { get; }
    IFiddle Crackpot { get; }
}

(The concrete IFiddleFrobblers and IFiddles depend on configurations and are created by a factory.)

I repeatedly stumble on the naming of such "umbrella" types - I want to exchange the "Frobbler" with something descriptive.

  • "Collection", "List" and "Set" aren't good enough, in the sense that it's not a collection/list/set where elements can be enumerated, added or removed.
  • "Manager" is out, because there's no management being done - the factory and configurations handle that.
  • "Aggregator" makes it sound like picked straight from the GoF book (although I don't think they would break "the law of demeter" - that's out of topic here).

Please, enlighten me, what's a good naming scheme for my "umbrella" types?


Edit: As xtofl pointed out in a comment, there's actually more semantics to this than I first exposed above. If I instead do the following, I think my need is clearer:

//
// Used for places where the font width might need
// to be tapered for a rendered  text to fit.
//
public interface ITaperableFont
{
    Font Font { get; }
    Boolean CanTaper { get; }

    void Taper();
}

//
// Used for rendering a simple marked-up text in
// a restricted area.
//
public interface ITaperableFonts
{
    ITaperableFont Biggest{ get; }
    ITaperableFont Big { get; }
    ITaperableFont Normal { get; }
    ITaperableFont Small { get; }
    ITaperableFont Smallest { get; }
}

In fact, I've identified my problem in the real-life addition above as a design flaw, not a naming problem, the smell of which several people has pointed out below.

like image 807
Johann Gerell Avatar asked Feb 24 '10 09:02

Johann Gerell


People also ask

Is umbrella good skullgirls?

Umbrella excels at grappler and trap-based gameplay, rewarding players with long, damaging combos if they can plan ahead and make careful use of her bubbles, puddles, and Hungern's monstrous appetite. Although she has many offensive options, Umbrella is very slow on her feet.

Who are the 43 babies in Umbrella Academy?

The 43 children are super powered beings born on the 12th hour on the first day of October 1989, all born from women who were not pregnant when the day began. Only 14 of these 43 children are currently known. In the original timeline, seven of these children were adopted by Sir Reginald Hargreeves.


1 Answers

Can you just use the plural: IFiddles?

like image 176
ChrisW Avatar answered Oct 08 '22 00:10

ChrisW