n-Tier Question

S

SolFrankRosen

Thanks in advance.... I am putting together some new enhancements to
an existing desktop application that uses a 3-tier solution (Data-
Broker-GUI or Server-Entity-GUI). The broker is a class that makes a
connection to the database using another layer that makes the actual
connection ( dataAdapter, dsFill, etc.) to the SQLserver database.
There is an individual broker for each GUI in the app. What I need
clarification on is within the entity layer there is a 'collection'
entity with code such as:

<Serializable()> _
Public Class AppUsers : Inherits CollectionBase

Default Public ReadOnly Property Item(ByVal index As Integer) As
AppUser
Get
Return CType(List.Item(index), AppUser)
End Get
End Property

Public Function Add(ByVal value As AppUser) As AppUser
Return Me.Item(List.Add(value))
End Function........
.......End Class 'AppUser

Another layer contains code such as:

<Serializable()> _
Public Class AppUser : Implements IComparable

Private m_Key As Integer
Private m_Login As String
Private m_Lname As String
Private m_Fname As String
Private m_MI As String
Private m_Role As String
Private m_NewAsset As String
Private m_LookUpTables As Boolean
Private m_PC As Boolean
Private m_HR As Boolean
Private m_ID As Integer

Public Enum MaxLength
login = 8
password = 8
End Enum

Public Property Key() As Integer
Get
Return m_Key
End Get
Set(ByVal Value As Integer)
m_Key = Value
End Set
End Property

Public Property EmpID() As Integer
Get
Return m_EmpID
End Get
Set(ByVal Value As Integer)
m_EmpID = Value
End Set
End Property
Public Overloads Overrides Function Equals(ByVal obj As Object) As
Boolean

Try
Return Me.Key.Equals(CType(obj, AppUser).Key)
Catch
Return False
End Try

End Function 'Equals

End Class 'AppUser


Right now I'm just looking for anyone familiar with this model to
begin a thread of a couple of questions to help me understand this
model particularly the two layers with the above code. thanks! Sol R.
 
G

Guest

Right now I'm just looking for anyone familiar with this model to
begin a thread of a couple of questions to help me understand this
model particularly the two layers with the above code. thanks! Sol R.

Take a look at LLBLGen Pro or CodeSmith. They are automatic code generators
to solve issues like this.
 
R

RobinS

Did you have a particular question in mind?

By the way, check out Deborah Kurata's book, Doing Objects in VB2005. It is
about using business objects and the 3-tier solution, and I found it
incredibly useful.

RobinS.
GoldMail, Inc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top