Inside Java, you run into the push-pull quandary all the time. All your classes are bristling with get/set methods, but whose job it is to call the get method of class A, and relay the information to the corresponding set method of class B? E.g. where A is a data object and B is the corresponding GUI (Graphic User Interface) object. If A does it, you are pushing. If B does it you are pulling. If class C does it you are controlling.
GUI objects are usually tree structured, Panels within Frames. Frequently, data passed to a Frame gets then passed to a Panel and finally to some Component, with often many more layers than that. Should data be relayed down the hierarchy or passed directly?
You can see there many possible combinations of push/pull and indirect/direct, all of which would technically work. However, if you are not careful, you will create a rat’s nest, and you will have no idea how to find the code you are looking for.
Here are some rules of thumb to help create order:
|
|
You can get the freshest copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) |
| http://mindprod.com/jgloss/pushpull.html | J:\mindprod\jgloss\pushpull.html | |
![]() | ||
| Canadian Mind Products | ||
| mindprod.com IP:[65.110.21.43] | ||
| view Blog | Your face IP:[38.107.179.212] | |
| Feedback | You are visitor number 15,194. | |