Let's take a step back from the code for a second. Can you describe the design of your system for which this set of classes will be the implementation?
You have a pressure vessel. That pressure vessel has two pipes, named inlet and outlet, and a mass flow rate.
Each pipe has its own mass flow rate.
- When are pressure vessels allowed to change pipes? Are they fixed when the pressure vessels are created or can they be changed at all?
- Can you have a pipe without a pressure vessel?
- Can you have a pressure vessel without a pipe?
- Who is allowed to query and/or change a pressure vessel's mass flow rate? Can the pressure vessel? Can either of its associated pipes?
- Who is allowed to query and/or change a pipe's mass flow rate? Can the pipe itself? Can the pressure vessel with which it's associated?
- What is the interaction between a pressure vessel's mass flow rate and its inlet and outlet pipe's mass flow rate?
- If a pipe must be associated with a pressure vessel, and if its mass flow rate can change to a value that's incompatible with the pressure vessel's, whose responsibility is it to detect that incompatibility?
- What actions should you be able to take on a pressure vessel?
- What actions should you be able to take on a pipe?
Knowing the answers to some of these questions will help determine how tightly coupled the software modeling those objects should be. [I hope that the physical pressure vessel and its pipes are tighly coupled, say with strong welds, especially if high pressures are involved!]