help me.
- From: "Leon Wu" <wuziqiang@xxxxxxxxx>
- Date: 21 Sep 2006 20:24:42 -0700
If I post in wrong place. forgive me.
I hope some one can Refactor following code for me!
We have a system with 6 application. One application (Named it
ContrlPanel) is a control center, it get command from UI and order
other application do some work. All these application communicate with
each other through share memory. so now all job of ControlPanel is like
following.
1. poll the state of A.
2. according to the state of A order B to do something.
3. poll the state of C.
4. according to the state of C order E or F to do something.
because all this job with share memory need do again and again till
succeed.(try to lock it etc).
so we get some code like following
XXXXThread
{
while (!exit)
{
switch(state) {
case GETING_A_STATE:
if (GetAState()) {
state = DOING_SOMETHING_A;
}
break;
case DOING_SOMETHING_A:
if (DoSomeA()) {
state = GET_C_STATE;
}
break;
case GET_C_STATE:
....
}
}
}
.
- Prev by Date: Re: Is this too much OOP?
- Next by Date: help me.
- Previous by thread: Internal State vs. Navigating Associations
- Next by thread: help me.
- Index(es):
Relevant Pages
|