Design issue [modified]
-
Help! I'm having trouble reverse engineering the following to OO principles since I'm new to OO. We are rebuilding an old app which was built without any OO applied back in the day. It has a screen which lets us edit payment conditions. The form has a code, description and 2 more controls: an editbox (holds a number) and a combobox (payment condition). The combobox holds 3 values: "cash", "xx days after delivery", "xx months after develivery". In the editbox I can enter a numeric value between 1 and 99. If I select "cash" in the combobox, the editbox is disabled. if I select "xx days after delivery" the editcontrol hold 1..99 days. If I select "xx months after delivery" the value suddenly means 1..99 months. How should my objectmodel look in OO? I'm not sure how to implement the edit/combobox-combination of requirements. The combobox is a fixed value, but the edit makes it variable. Any help is appreciated. Regards, Ted
- Life would be so much easier if I had the source code! - If Java had true garbage collection, most applications would delete themselves upon execution ;)
modified on Thursday, May 27, 2010 7:54 AM
-
Help! I'm having trouble reverse engineering the following to OO principles since I'm new to OO. We are rebuilding an old app which was built without any OO applied back in the day. It has a screen which lets us edit payment conditions. The form has a code, description and 2 more controls: an editbox (holds a number) and a combobox (payment condition). The combobox holds 3 values: "cash", "xx days after delivery", "xx months after develivery". In the editbox I can enter a numeric value between 1 and 99. If I select "cash" in the combobox, the editbox is disabled. if I select "xx days after delivery" the editcontrol hold 1..99 days. If I select "xx months after delivery" the value suddenly means 1..99 months. How should my objectmodel look in OO? I'm not sure how to implement the edit/combobox-combination of requirements. The combobox is a fixed value, but the edit makes it variable. Any help is appreciated. Regards, Ted
- Life would be so much easier if I had the source code! - If Java had true garbage collection, most applications would delete themselves upon execution ;)
modified on Thursday, May 27, 2010 7:54 AM
Hi, Ted... Not sure what is meant by OO in this context. Looks more like a UI design issue. I think I'd ditch the textbox/combobox combination and go with RadioButtons, NumericUpDown and Labels. Wish I could insert an image here, but, it would look like this: > Three RadioButtons stacked in a column. > The Text for the top radio button would be "Cash". > The Text properties for the other two RadioButtons would be blank. > The second RadioButton would be followed by a NumericUpDown control with a Minimum of 1 and Maximum of 99. To the right of this NumericUpDown control would be a Label that displays "days after delivery". > The third RadioButton would be followed by another NumericUpDown control with a Minimum of 1 and a Maximum of 12. To the right of this NumericUpDown control would be a label that displays "months after delivery". The user would select a radio button and, if needed, either enter or select the number of days/months. Based on which radio button is selected, the program will know how to react. Hope that makes sense. A screen capture would be better. If you want one, I can email it to you. George