Connascence of Name

Connascence of name is the lowest level of connascence in the static category. Connascence of name refers to when multiple components must agree on the name of a particular entity. 

Consider the following class:

Our Dinosaur class has connascence of name- both for the class declaration and the method declaration. If we change the class from Dinosaur  to Chicken , anything that references the class by name will break. If we change the method name from feed()  to devour()  or anything else, anything that is using that method will break. All components that use Dinosaur  are dependent on the names that it uses.

You can’t get rid of connascence of name- it’s fundamental to the way we refer to different components and entities in programming. Whenever we change the name of a component in it’s declaration, we always have to change all code that refers to the old name. This is why we refer to connascence of name as the lowest level of connascence- it’s littered all over our codebases, and there’s not anything we can do about it.

Author: Sean O'Toole

I like development and I like dinosaurs. Here we are.

Leave a Reply

Your email address will not be published. Required fields are marked *