Initially, there was a DAL object that my BO called for information, and then passed to the user interface. Then I started to notice reduced code in the user interface and there were Controller classes. What a decent recommendation.
I am currently structuring my
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 initially discovered that with the generic class I didn't need to create a new DAL instance when I needed to receive data
Dim _orderDAL as New OrderDal
_orderDAL.GetOrder(1234)
.....
What do you take?
thanks
source
share