Hi, Originally there was the DAL object which my BO's called for info and then passed to UI. Then I started noticing reduced code in UI and there were Controller classes. What's the decent recomendation.
I currently structure mine
Public Class OrderDAL
Private _id Integer
Private _order as Order
Public Function GetOrder(id as Integer) as Order
...return Order
End Function
End Class
then I have controller classes (recently implemented this style)
Public Class OrderController
Private Shared _orderDAL as new OrderDAL
Public Shared Function GetOrder(id) As Order
Return _orderDAL.GetOrder(id)
End Function
End Class
Then in my application
My app Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
msgbox(OrderController.GetOrder(12345).Customer.Name)
End Sub
End app
I originally found that with the Shared Class I didn't have to keep creating a new instance of the DAL whenever I need to fetch data
Dim _orderDAL as New OrderDal
_orderDAL.GetOrder(1234)
.....
What's your take?
Thanks