views:

47

answers:

2

For example is

MyLibrary.Data.Import.Hotels

Bad Vs

MyLibrary.Data.Import.ImportHotels

Or even

MyLibrary.Data.ImportHotels
+3  A: 

IMO!:

Verb should be used only on method names. Classes names should be nouns. Same for namespaces. My version MyLibrary.Data.Hotel.Import() or something like this

Andrey
A: 

As Andrey pointed out, class names are describing classes of objects.

The instances of that class are the objects themselves, e.g. the class is Hotel and an instance of that class could be an object for "The Ritz".

Some nouns can further be used to add attributes of the object, e.g. number of rooms, hotel name, number of vacant rooms, etc.

Verbs are then used to describe actions upon the object instance or attributes, e,g. setNumberOfRooms, getNumberOfVacantRooms, etc.

How could you say a verb is an object? Just looking at your object heirarchy's raises a bit of a smell. In the refactoring sense of course! (-:

For further information, I can't recommend the book "Object Oriented Systems Analysis: Modeling the World in Data" highly enough. It's from the early days of OOA but still highly relevant today.

HTH

Rob Wells