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:
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?
Sounds like an ILocateable. Something whose location you can discover and track.
Edit:
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.
IWhereYouAtable - Boost mobile
ITwentyable - as in what's your 20 (short for 10-20 - CB slang)
seriously though ILocateable is good.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.