Group: Forum Members
Posts: 2K,
Visits: 6.6K
|
It just occurred to me, is it better to use ExecuteScalar() directly or to use the parent BO and a Get method that uses execute scalar? I.e. which is better
LinkBO - connects to tblWidgetFactoryLink
WidgetFactoryLinkID - pk for tblWidgetFactoryLink
WidgetID - reference to Widget, from tblWidgetFactoryLink
FactoryID - reference to Factory, from tblWidgetFactoryLink
WidgetName - custom property using "Select WidgetName From tblWidget Where WidgetID = @id", @id = currentrow WidgetID, ExecuteScalar(cmd)
OR
LinkBO - connects to tblWidgetFactoryLink
(same fields as above, except...)
WidgetName - custom property using the WidgetBO.GetWidgetNameByID(currentrow WidgetID)
It seems to me that in the first case, you have coupled the LinkBO to the database, while in the second you have coupled it to the WidgetBO. Are there performance issues using the second way? Does the second way improve flexibility, say when moving from a database to a web service?
|