由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - What's good way to pass intermediate results?
相关主题
GUI libraries for JDeveloper?How about Swing?
Configuration File reading.. xml?spring Annotation based configuration
XML configuration read/write?Help
现在有些迷惑了Simple question
不明白Spring Framework很正常传递一个object reference,如何防止更改object?
A design for parameter passingjava 写unit test 给clover 真就是农民阿
how to update swing componentshow to solve the problem: the members change by each other .
@goodbug: Wicket vs JSF一个多线程问题
相关话题的讨论汇总
话题: pass话题: way话题: what话题: component
进入Java版参与讨论
1 (共1页)
g**********y
发帖数: 14569
1
In a sequential computing program, what is the best way to pass intermediate
result among classes?
For example, component A generates by-product O, which will be used by
component B and C.
Make by-product O global is one-way, but not good choice.
Pass O from A to B, C is another way, but I don't like that idea either. A
becomes depending on B and C.
g*****g
发帖数: 34805
2
How about keep 0 as a field of A, and make a getter for it.
Pass A to B and C.

【在 g**********y 的大作中提到】
: In a sequential computing program, what is the best way to pass intermediate
: result among classes?
: For example, component A generates by-product O, which will be used by
: component B and C.
: Make by-product O global is one-way, but not good choice.
: Pass O from A to B, C is another way, but I don't like that idea either. A
: becomes depending on B and C.

g**********y
发帖数: 14569
3

That makes B and C depends on A. I really want to cut this dependency. Problem
is, B and C doesn't know A instance. My central controller is configured in
very general way, even controller doesn't know there is an A instance. It
generates objects from XML and execute method as specified.

【在 g*****g 的大作中提到】
: How about keep 0 as a field of A, and make a getter for it.
: Pass A to B and C.

c****r
发帖数: 185
4
Create a new component to interact with A, B, and C.
See mediator pattern.

Problem

【在 g**********y 的大作中提到】
:
: That makes B and C depends on A. I really want to cut this dependency. Problem
: is, B and C doesn't know A instance. My central controller is configured in
: very general way, even controller doesn't know there is an A instance. It
: generates objects from XML and execute method as specified.

1 (共1页)
进入Java版参与讨论
相关主题
一个多线程问题不明白Spring Framework很正常
发现java码工有个好处A design for parameter passing
请教关于使用map和fieldshow to update swing components
get输出到Json@goodbug: Wicket vs JSF
GUI libraries for JDeveloper?How about Swing?
Configuration File reading.. xml?spring Annotation based configuration
XML configuration read/write?Help
现在有些迷惑了Simple question
相关话题的讨论汇总
话题: pass话题: way话题: what话题: component