@Albert D. Kallal,
Thank you for your reply.
Your definition of a re-usable control is completely different from mine.
Yes, it is differrent. Keep in mind, that you suggesting benefits arise that the form now does not have that binding information.
However, all you done is move that developer workload to another location - you STILL have to do that work!
Remember, I do a LOT of web development work now, so I well grasp the concept of separating UI code from business logic code.
Asp.net "MVC" is a perfect example of this approach.
(Model-View-Controller).
MVC is a design pattern used to separate concerns in web applications by decoupling the user interface (view), data (model), and application logic (controller). This pattern helps in organizing code in a more maintainable and testable way.
However, you at the end of the day simply shuffling the developer workload from one location (in the form) to another location,
not that you eliminate having to do this!
So, while there are benefits to moving as much code and logic out of the UI? There are also MANY benefits to do so!!!!
In the Enter event of that control it is told how this control must behave, that is the binding to Fields and Business rules. My interpretation of re-usable controls.
Sure, but you still having to outline and define that binding process - it's still being done, just not in the form anymore. So, the question then becomes how great are the benefits vs the downsides of this approach?
As noted, right now, since we "often" have to move some code and forms from the internal Access application to that of the customer facing web portal? (a great recent example is after a customer has approved a project, then we present them with the shipping page - and they can edit the shipping address, select other locations they have, and also enter comments). And same goes for approval process - used to be 1000+ lines of VBA code. That code still exists, but now both web site, and VBA/Access desktop uses the .net business object for that code. Hence, one code based is shared between the web site, and the Access desktop. And over time, we are moving more and move VBA code into that business object.
However, at the end of the day, mapping of data from that business object to the UI? We still have to do that work load. The fact that we moved boatloads of code out of our Access forms, and even data binding code out (say for web forms doing the same thing)?
The UI presentation is not just UI, but the UI has to behave in many special ways to achieve a desired result. In other words, the UI is NOT limited to JUST data binding (or removing that data binding), but has to do much more to create a great user experience.
This goes all the way back to people often suggesting that you can build a application using just wizards and have the UI work like magic.
No, you actually can't!!!
The REAL value of such systems is in fact attaching that business logic to that UI interface.
The fact that the business logic is moved out of the form? Don't matter in the sense that such code and UI mapping STILL is required - even if you move it someplace else.
The problem more often then not?
It not that you need or "can" re-use some form (and it's controls - that tends to be easy!).
However, to make great software, that UI will require special love and care. It's never really about some text box that is "bound" or not at design time, but building a UI that allows the end user to do their job. Attempts to eliminate this task don't work, and even .net MVC does not eliminate this issue.
Editing and binding data? Gee, that's not the bulk of application development since that's oh so easy anyway!
(however, you would be shocked in web land as to how people are still hand coding the loading of data from that class, or data source, and manually writing code (hand coding) to shuffle the data columns into that UI - we don't do that in Access, and I don't even do that for my web based software anymore ....
But, just a "shuffle" of data to/from the UI? That's not the hard part, and that's not the high value part that takes effort. That part of the development cycle is REALLY fast - even using bound forms. So, eliminating this task, or even automating it somewhat?
That's not where the developer costs are these days.....
I'll certainly give the sample a try in the next while -- and I appreciate you sharing these ideas here...
So, the concepts of moving as much out of a form? Sure, they are great concepts, but, it's not a 0 or 1 narrative either way on this issue, there are benefits of both approaches....
R
Albert