views:

132

answers:

4

I'm refactoring a number of classes in an application to use interfaces instead of base classes. Here's the interfaces I created so far:

  • ICarryable implemented by all Item objects
  • IActable implemented by all Actor objects
  • IUseable implemented by some Item sub-classes
  • IWieldable implemented by some Item sub-classes

You can see the major base-classes are still Item and Actor. These have a common interface in that they both are located on a Map, so they have a Location property. The Map shouldn't care whether the object is an Actor or an Item, so I want to create an interface for it. Here's what the interface would look like

public interface IUnnameable {
    event EventHandler<LocationChangedEventArgs> LocationChanged;
    Location Location { get; set; }
}

That's no problem, but I can't think of what to call this interface. IMappable comes to mind by seems a bit lame. Any ideas?

+9  A: 

Sounds like an ILocateable. Something whose location you can discover and track.

Matt Hamilton
+2  A: 
  • ILocatable
  • IGeo
  • IAmSomewhere
  • IIsSomewhere
BCS
@BCS, seems you've beat Matt to ILocateable. I like it so far, but I'll see if something better comes along before I mark your answer as accepted. I do like ILocateable, though :)
Mark A. Nicolosi
@Mark Matt got to it first... (sort by oldest)
BCS
Geez it must've been tight though. I don't mind if you mark BCS' as the answer.
Matt Hamilton
Drats - darn you Matt Hamilton! I swear I didn't see yours first. Sounds like there are at least two votes for it. :-)
Matt Cruikshank
@BCS, You're right, I must have looked at it the other way around. I've already voted you both up though :)
Mark A. Nicolosi
+1  A: 

I'd just use LOLCats notation.

ICanHasLocation

or maybe

IHasLocation

or the absurd

ImInYourProgramHavingALocation

Oh, and by the way - there's at least one Duck Typing library for C#, which is a pretty cool concept.

Matt Cruikshank
Neat library, although, I don't believe its needed for this. I think I like IHasLocation the most, but I'm going to choose ILocateable to be consistent with some of the other interface names in my project. Thanks ;)
Mark A. Nicolosi
A: 

IWhereYouAtable - Boost mobile

ITwentyable - as in what's your 20 (short for 10-20 - CB slang)

seriously though ILocateable is good.

Hafthor