This is a kind of design pattern question in Java.
I am developing a java .jar file to act as the basis for managing and processing a particular form of data. I want the end user to be able to dictate the plumbing configuration in certain constraints in a certain way. Parts are producers and / or consumers, and I know how to implement them, but the connections bother me ... here is an example of nonsense, sort of like parallels my application.
Suppose I implemented these elements:
AppleTree => produces applesApplePieMaker => consumes apples, produces apple piesApplePress => consumes apples, produces apple cider.AppleSave => stores apples, apple pies or apple cider to a fileAppleLoad => "restores" apples, apple pies or apple cider from a file created AppleSaveApplePieMonitor => displays apple pies on the screen in a graphical interface format, as they are created
Now I want the user to be able to specify things like:
AppleTree | ApplePress | AppleSave cider1.sav (produce apples, turn them into cider, save them to a file)AppleTree | AppleSave apple1.sav (produce apples, save them to a file)AppleLoad apple1.sav | ApplePieMaker | ApplePieMonitor (take the saved apples, make them into cakes, show the results on the screen in the graphical interface)(not sure how to illustrate this, but may be indicated as follows)
AppleTree tree1, ApplePieMaker piemaker1 <tree1, AppleSave apples.sav <tree1, AppleSave @select (*. Sav) <piemaker1, ApplePress press1 <tree1, AppleSave cider.sav <press1, ApplePieMonitor piemon1 <piemaker1
( , , , , , , , )
, , : , , 1 1 , , , , , .
, , . , , AppleConsumer, ApplePieConsumer .., ApplePieMaker AppleConsumer ( consumeApple()) AppleTree AppleProducer, , , AppleTree , consumeApple() , AppleTree, , ....
? ? .
edit: Java. ( , ) , , , , . , , -.