Implicit Dependencies Are also Dependencies

From WikiContent

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
A fairy tale.
A fairy tale.
-
'The not-so-fictituous project was developed in two countries. It was a large project, its functionality sufficiently complex to justify multiple processors / computers / servers for different portions of the job. For reasons of convenience, the project was split along the computer boundaries. Each development site became responsible for the software running on one computer. It had to fulfill their share of requirements, and to do their share of testing. As an interface between the computers, the communication protocol was specified according to the desired functionality.
+
''Once upon a time there was a project was developed in two countries. It was a large project, its functionality sufficiently complex to justify multiple servers for different portions of the job. For convenience, the project was split along the computer boundaries. Each development site became responsible for the software running on one computer. Each site had to fulfill its share of requirements and do its share of testing. The communication protocol between the computers was specified according to the desired functionality.''
-
'A few months later, each site declared victory: the software was finished. The integration team took over and plugged the components, errrh, computers together. They started working. A bit. Not much though: as soon as the most common scenarios were covered and the more interesting scenarios were tested, the interaction between the computers became unreliable.
+
''A few months later, each site declared victory: The software was finished! The integration team took over and plugged everything together. It seemed to work. A bit. Not much though: As soon as the most common scenarios were covered and the more interesting scenarios were tested, the interaction between the computers became unreliable.''
-
'Confronted with this finding, both teams held up the interface specification and claimed their software would conform to it. Actually, this was found to be true. Both sides declared victory, again. No code was changed, and they developed happily ever after.
+
''Confronted with this finding, both teams held up the interface specification and claimed their software conformed to it. This was found to be true. Both sides declared victory, again. No code was changed, and they developed happily ever after.''
-
Who cares for dependency management?
+
Software components have dependencies, particularly in large projects, particularly when you strive to increase your code reuse. You have dependencies, but that doesn't mean you like them.
-
Ten years ago, few people in industry projects did. Since then it became a commodity, a commonplace that is familiar even to product owners. Yes, software components have dependencies, particularly in large projects, particularly when you strive to increase your code reuse.
+
Dependencies make it hard to change code. Whenever you want to change code others depend on, you will encounter discussion and extra work, and possibly strong forces of resistance from other developers who would have to invest their time. This force can become very strong in environments with a lengthy development micro cycle, such as C++ projects or in embedded systems.
-
So now you have your dependencies: but you do not like them.
+
Many technical approaches have been adopted to avoid dependencies. Parameters are passed in a string format, keeping the interface technically unchanged, even though the interpretation of the string's contents changes. Recycle unused existing error codes to avoid having to define new ones, or reuse error codes differently from their intended meaning, and document the shift in meaning somewhere in your component documentation. At a larger scale, component communication has replaced direct interface calls by a more anonymous bus where you do not need to contact your service yourself. It just needs to be out there somehow.
-
 
+
-
Dependencies make it hard to change code. Whenever you would like to change some code that others depend upon, you will experience lots of talk and work, and possibly strong forces of inertia when other developers would have to invest their time. This force grows very strong when you happen to dwell in environments with a lengthy development micro cycle, like in C++ projects or in embedded systems.
+
-
 
+
-
Many technical constructs have been invented to avoid dependencies. Parameters are passed in a string format, keeping the interface technically unchanged even when the string contents' interpretation changes. Component communication has replaced direct interface calls by a more anonymous bus where you do not need to contact your service yourself. It just needs to be out there somehow.
+
Here is the first warning: Obfuscated dependencies are also dependencies.
Here is the first warning: Obfuscated dependencies are also dependencies.
-
All technical independence does not relieve you (your project team) from taking care of it all. Changing an interface parameter's meaning is the same as changing the interface. You might have removed the compiler step, but you have not removed the need for deployment. Plus, you've added plenty opportunity for confusion that will haunt your during development, test, integration, and in the field — when you least expect it.
+
Source-level or binary independence does not relieve you or your team from dependency management. Changing an interface parameter's meaning is the same as changing the interface. You may have removed a compilation step, but you have not removed the need for redeployment. Plus, you've added opportunities for confusion that will boomerang during development, test, integration, and in the field — returning when you least expect it.
-
Looking at sound advice from software experts, you hear Fred Brooks talking you into conceptual integrity and Kent Beck advising to DRY (don't repeat yourself). While these concepts increase the clarity of your code and work against obfuscation, they also increase your dependencies. Now you have to refer to that one integer place from all your code. Good development practices increases your dependencies.
+
Looking at sound advice from software experts, you hear Fred Brooks talking you into conceptual integrity, Kent Beck urging once and only once, and the Pragmatic Programmers advising you to keep it DRY (Don't Repeat Yourself). While these concepts increase the clarity of your code and work against obfuscation, they also increase your dependencies.
Second warning: Application dependencies are also dependencies.
Second warning: Application dependencies are also dependencies.
-
With increasingly powerful code generation machines, it is very tempting to place the application knowledge into some model, and then to generate code that is independent of other code portions. All code fragments will live in technical independence. However, their combined behaviour is only meaningful if all the right code versions fit together, stem from the same model. So technical dependencies will not show you the entire picture: the implicit (i.e.: not visible in code) application dependencies are also dependencies.
+
With increasingly powerful code generation engines, it is very tempting to place the application knowledge into some model, and then generate code that is technically independent of other code portions. However, their combined behaviour is meaningful only if all the versions fit together and stem from the same model. Explicit dependencies will not give you the whole picture: The implicit application dependencies that are not directly visible in code are also dependencies.
 +
 
 +
 
 +
By [[Klaus Marquardt]]
 +
 
 +
This work is licensed under a [http://creativecommons.org/licenses/by/3.0/us/ Creative Commons Attribution 3]
-
Third warning: Do not make your code depend on some file that is intended to change as the project progresses.
 
-
It is very convenient to have a global file that, for example, lists all error codes in the system. When starting the new component, you proudly add a handful: look, I am a part of this! Only to find your colleagues moan about the extra build time. How dare you change this file?
 
-
Couldn't you just do what everybody does: reuse some error codes that are already in there, or reuse some error codes despite their intended meaning, and document the shift in meaning somewhere in your component documentation.
+
Back to [[97 Things Every Programmer Should Know]] home page

Revision as of 07:13, 7 August 2009

A fairy tale.

Once upon a time there was a project was developed in two countries. It was a large project, its functionality sufficiently complex to justify multiple servers for different portions of the job. For convenience, the project was split along the computer boundaries. Each development site became responsible for the software running on one computer. Each site had to fulfill its share of requirements and do its share of testing. The communication protocol between the computers was specified according to the desired functionality.

A few months later, each site declared victory: The software was finished! The integration team took over and plugged everything together. It seemed to work. A bit. Not much though: As soon as the most common scenarios were covered and the more interesting scenarios were tested, the interaction between the computers became unreliable.

Confronted with this finding, both teams held up the interface specification and claimed their software conformed to it. This was found to be true. Both sides declared victory, again. No code was changed, and they developed happily ever after.

Software components have dependencies, particularly in large projects, particularly when you strive to increase your code reuse. You have dependencies, but that doesn't mean you like them.

Dependencies make it hard to change code. Whenever you want to change code others depend on, you will encounter discussion and extra work, and possibly strong forces of resistance from other developers who would have to invest their time. This force can become very strong in environments with a lengthy development micro cycle, such as C++ projects or in embedded systems.

Many technical approaches have been adopted to avoid dependencies. Parameters are passed in a string format, keeping the interface technically unchanged, even though the interpretation of the string's contents changes. Recycle unused existing error codes to avoid having to define new ones, or reuse error codes differently from their intended meaning, and document the shift in meaning somewhere in your component documentation. At a larger scale, component communication has replaced direct interface calls by a more anonymous bus where you do not need to contact your service yourself. It just needs to be out there somehow.

Here is the first warning: Obfuscated dependencies are also dependencies.

Source-level or binary independence does not relieve you or your team from dependency management. Changing an interface parameter's meaning is the same as changing the interface. You may have removed a compilation step, but you have not removed the need for redeployment. Plus, you've added opportunities for confusion that will boomerang during development, test, integration, and in the field — returning when you least expect it.

Looking at sound advice from software experts, you hear Fred Brooks talking you into conceptual integrity, Kent Beck urging once and only once, and the Pragmatic Programmers advising you to keep it DRY (Don't Repeat Yourself). While these concepts increase the clarity of your code and work against obfuscation, they also increase your dependencies.

Second warning: Application dependencies are also dependencies.

With increasingly powerful code generation engines, it is very tempting to place the application knowledge into some model, and then generate code that is technically independent of other code portions. However, their combined behaviour is meaningful only if all the versions fit together and stem from the same model. Explicit dependencies will not give you the whole picture: The implicit application dependencies that are not directly visible in code are also dependencies.


By Klaus Marquardt

This work is licensed under a Creative Commons Attribution 3


Back to 97 Things Every Programmer Should Know home page

Personal tools