Thursday, August 16, 2007

Early Binding !?

(Because of my poor English and this document is quite technical, you may have difficulty to fully understand it. If you really don't understand, please leave comment and I will try to explain in more detail)

Nowadays, many development tools (e.g. NET) always claims that they have many feasibility to provide the early binding. Actually, early binding could benefit the system that minimize problem occurred during the runtime since some typo problem (e.g. RecordSet("CustomerID") but typed RecordSet("CutomerIE")) could be captured during the development phase. That's why the trend of all development will try to switch to early binding approach. And that's why something called LINQ and Hibernate modules are built to direct link the DB and create the appropriate entity object with strong typed fields.

However, this approach is still not mature to handle the UI. If the outlook of the UI is dynamic and could be changed during the runtime, we couldn't located that control during the design phase. We only could build some mechanism to detect (e.g. Findcontrol function in .NET) the control. This may increase the risk of the system since we couldn't predict what happen in the runtime (e.g. What happen if the control is expected under that status but couldn't found). We may capture wrong control and doing wrong action during runtime.

Actually, I think this problem could be solved if the framework could help to identify all control's ID during design time, no matter it is visible or invisible during runtime, and store these information in the framework. Therefore, we could locate all the controls while in the development phase to help us to build a better solution.

"FindControl" is a powerful function to handle some tough UI logics. However, it is still better don't over use this function to minimize the risk. I still would suggest try to use some earlier binding solution if possible.

No comments: