Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need help choosing a name for an interface

Tags:

c#

.net

naming

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?

like image 648
Mark A. Nicolosi Avatar asked Oct 16 '08 04:10

Mark A. Nicolosi


People also ask

How should you name interfaces?

Interface names should be capitalized like class names. Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized. Except for variables, all instance, class, and class constants are in mixed case with a lowercase first letter.

What is an example of an interface name?

Each network interface has a name. This usually consists of a few letters that relate to the type of interface, which may be followed by a number if there is more than one interface of that type. Examples might be lo (the loopback interface) and eth0 (the first Ethernet interface).

How are network interfaces named?

Network interface names are based on whether the interface is a physical or virtual network interface. Physical interfaces are assigned names based on the slot number of the adapter. Interface group names are user specified. VLANs are named by combining the interface name and VLAN ID.


1 Answers

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

like image 133
Matt Hamilton Avatar answered Oct 30 '22 15:10

Matt Hamilton