Skip to main content

The article I read recommended using very specific names. If it was a C++ application and the UserManager's job was allocating and freeing users from the Heapheap it would not manage the users but to guard their birth and death. Hmm, maybe we could call this a UserSheperdUserShepherd.

Now that this idea stuck with me I try to apply it. AndAnd find this simple idea amazingly hard.

Ultimately I'd like to have something like a pattern catalogue in my mind (frequently design patterns easily provide the object names, for example withe.g. a factoryfactory)

  • Factory - Creates other objects (naming taken from the design pattern)

  • Shepherd - A shepherd handles the lifetime of objects, their creation and shutdown

  • Synchronizer - Copies data between two or more objects (or object hierarchies)

  • Nanny - Helps objects reach "usable" state after creation - for example by wiring to other objects

  • etc etc.

So, how do you handle that issue? Do you have a fixed vocabulary, do you invent new names on the fly or do you consider naming things in the way as I describe as not-so-important or wrong?

P.S.: I'm also interested in links to articles and blogs discussing thatthe issue. As a start, here is the original article that got me thinking about it: Naming Java Classes without a 'Manager'

And a current list of name prefixes/sufficessuffixes I collected (subjectivlysubjectively!) from the answers:

And a good tip onfor the road:

The article I read recommended using very specific names. If it was a C++ application and the UserManager's job was allocating and freeing users from the Heap it would not manage the users but to guard their birth and death. Hmm, maybe we could call this a UserSheperd.

Now that this idea stuck with me I try to apply it. And find this simple idea amazingly hard.

Ultimately I'd like to have something like a pattern catalogue in my mind (frequently design patterns easily provide the object names, for example with a factory)

  • Factory - Creates other objects (naming taken from the design pattern)

  • Shepherd - A shepherd handles the lifetime of objects their creation and shutdown

  • Synchronizer - Copies data between two or more objects (or object hierarchies)

  • Nanny - Helps objects reach "usable" state after creation - for example by wiring to other objects

  • etc etc.

So, how do you handle that issue? Do you have a fixed vocabulary, do you invent new names on the fly or do you consider naming things in the way as I describe as not-so-important or wrong?

P.S.: I'm also interested in links to articles and blogs discussing that issue. As a start here is the original article that got me thinking about it: Naming Java Classes without a 'Manager'

And a current list of name prefixes/suffices I collected (subjectivly!) from the answers:

And a good tip on the road:

The article I read recommended using very specific names. If it was a C++ application and the UserManager's job was allocating and freeing users from the heap it would not manage the users but guard their birth and death. Hmm, maybe we could call this a UserShepherd.

Now that this idea stuck with me I try to apply it. And find this simple idea amazingly hard.

Ultimately I'd like to have something like a pattern catalogue in my mind (frequently design patterns easily provide the object names, e.g. a factory)

  • Factory - Creates other objects (naming taken from the design pattern)

  • Shepherd - A shepherd handles the lifetime of objects, their creation and shutdown

  • Synchronizer - Copies data between two or more objects (or object hierarchies)

  • Nanny - Helps objects reach "usable" state after creation - for example by wiring to other objects

  • etc etc.

So, how do you handle that issue? Do you have a fixed vocabulary, do you invent new names on the fly or do you consider naming things not-so-important or wrong?

P.S.: I'm also interested in links to articles and blogs discussing the issue. As a start, here is the original article that got me thinking about it: Naming Java Classes without a 'Manager'

And a current list of name prefixes/suffixes I collected (subjectively!) from the answers:

And a good tip for the road:

correct typo
Source Link
mallardz
  • 1.1k
  • 12
  • 22
  • Try not to create new methaphorsmetaphors (Nanny)
  • Have a look at what other frameworks do
  • Try not to create new methaphors (Nanny)
  • Have a look at what other frameworks do
  • Try not to create new metaphors (Nanny)
  • Have a look at what other frameworks do
Post Closed as "not constructive" by casperOne
Added summary; added 11 characters in body
Source Link
user60229
user60229
Loading
added 131 characters in body
Source Link
user60229
user60229
Loading
Post Made Community Wiki by user60229
deleted 2 characters in body
Source Link
Jim Ferrans
  • 31k
  • 12
  • 58
  • 83
Loading
Source Link
user60229
user60229
Loading