Server control/data access best practice?
Is it better to access data from within the web parent app and pass the necessary data to the control and back via properties, or pass a reference or url pointer (of webservice) to contro开发者_如何转开发l and let it access the data for the fields it encompasses keeping in mind that the parent doesn't need to use the data anywhere else that the server control uses.
The idea is you don't want the UI interacting with the db layer. So you abstract that data by creating a datalayer (basically a class which you can compile down to an assembly / dll). Your UI talks to the BLL which in turn talks to the DAL.
I think that usually it would be easier to manage the control by the app, but in some scenarios especially when you don't need the application to access the data you can just embed the control, e.g. when you want to embed an external video player etc. or some external web-part or other frame.
精彩评论