I am currently working on a project that is fairly small for the time being. There was a recent change to implement 3-tier architecture, such that the code is now split up appropriately to data access, business logic and user interface tiers. However, there is no use of objects outside of creating them to ultimately call a data access method.
At a very basic level, pretty much everything we do is:
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load Dim dt As New DataTable dt = objBl.GetSomething 'Assign to Grid 'Format Grid End Sub
I want to implement something more like:
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load Dim lstSomeObject As New List(Of SomeObject) 'Populate list of objects by calls to business layer DataGridView1.DataSource = lstSomeObject 'Format Grid End Sub
Ultimately, not much different. But instead of us having to pass thirty variables through to get a resultant data table that is used once, we could create an object (and lists of objects) and pass these around instead. I have a couple years experience working in such an environment, but zero experience in converting to such an environment. Frankly, I am at a loss as to how to do this.
Do I create a separate entities project for this, and then does everything reference this? Or do I force our current objects to store both the properites and methods for each object type (this way feels counter-intuitive to me)? Or something else entirely? I have searched around most of the weekend and have not found anything overly helpful.