473,237 Members | 1,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 software developers and data experts.

Passing business objects from business tier to data tier?

Greetings,

I am developing this N-tier business app. The problem I'm facing is
when I try to pass business objects (employees, dept..etc) from
business tier to data tier,i.e., the add method in the data tier
expects business object from the business tier, I get an error saying:
Can not covert businesslayer.emp to businesslayer.emp

Code:

'Business Tier/Employee Class
Public Class emp

Dim name_ As String
Dim clsEmpDataNew As New DataTier.clsEmpData

Property Name() As String
Get
Return name_
End Get
Set(ByVal Value As String)
name_ = Value
End Set
End Property
Function AddNewEmployee(ByVal emp As emp) As Integer
clsEmpDataNew.AddEmployee(emp) 'here where the error occurs
saying can't covert types
End Function

''''Data tier Code
Public Class clsEmpData
Function AddEmployee(ByVal empNew As BusinessTier.emp) As Boolean
'code to call stored procedure
End Function
End Class

Any idea how to solve this? I know I can represent my business
objects as datasets instead of classes, but I found it to be
restrictive more than classes.

MTIA,
Grawsha

May 11 '07 #1
2 2606
gr*********@yahoo.com wrote in news:1178917988.623370.82100
@e65g2000hsc.googlegroups.com:
I am developing this N-tier business app. The problem I'm facing is
when I try to pass business objects (employees, dept..etc) from
business tier to data tier,i.e., the add method in the data tier
expects business object from the business tier, I get an error saying:
Are you using a common interface between the tiers?
May 11 '07 #2

To do this. you need to put those classes in a seperate assembly, NOT the
biz assembly.

http://msdn.microsoft.com/library/de...tml/BOAGag.asp
Deploying Business Entities
Business entities are used at many different tiers in your application.
Depending on how you implement your business entities, you may need to
deploy them to multiple locations if your application spans physical tiers.
The following list describes how to deploy business entities in different
implementation scenarios:

a..
b.. Deploying Business Entities implemented as custom business entity
components. The custom entity class may need to be accessed by the Data
Access Logic Component, depending on how you defined the method signatures
in the Data Access Logic Component.
c.. Follow the same recommendation as for typed DataSets **** by defining
custom entity classes in a common assembly to be deployed on multiple tiers
***.
The data layer should NOT reference the biz layer. The biz layer should
reference the data layer.

When you need objects/datasets among the tiers, they go into a common
("Glue") assembly.


See
5/24/2006
Custom Objects/Collections and Tiered Development
http://sholliday.spaces.live.com/blog/
<gr*********@yahoo.comwrote in message
news:11*********************@e65g2000hsc.googlegro ups.com...
Greetings,

I am developing this N-tier business app. The problem I'm facing is
when I try to pass business objects (employees, dept..etc) from
business tier to data tier,i.e., the add method in the data tier
expects business object from the business tier, I get an error saying:
Can not covert businesslayer.emp to businesslayer.emp

Code:

'Business Tier/Employee Class
Public Class emp

Dim name_ As String
Dim clsEmpDataNew As New DataTier.clsEmpData

Property Name() As String
Get
Return name_
End Get
Set(ByVal Value As String)
name_ = Value
End Set
End Property
Function AddNewEmployee(ByVal emp As emp) As Integer
clsEmpDataNew.AddEmployee(emp) 'here where the error occurs
saying can't covert types
End Function

''''Data tier Code
Public Class clsEmpData
Function AddEmployee(ByVal empNew As BusinessTier.emp) As Boolean
'code to call stored procedure
End Function
End Class

Any idea how to solve this? I know I can represent my business
objects as datasets instead of classes, but I found it to be
restrictive more than classes.

MTIA,
Grawsha

May 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Simon Harvey | last post by:
Hi, In my application I get lots of different sorts of information from databases. As such, a lot of information is stored in DataSets and DataTable objects. Up until now, I have been passing...
25
by: Stuart Hilditch | last post by:
Hi all, I am hoping that someone with some experience developing nTier apps can give me some advice here. I am writing an nTier web app that began with a Data Access Layer (DAL), Business...
5
by: G. Stewart | last post by:
The word "Business" in the term implies some sort of commercial aspects or connotations. But from what I can see, that is not necesserially the case at all? So what is the reasoning behind the...
8
by: Keith-Earl | last post by:
Okay, looking for a Best Practice. We are building a classic three tier app in VB.NET. When we load up a WebForm we have access to very useful objects such as the Session object. We frequently...
18
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
1
by: Nemisis | last post by:
hi guys, Currently converting an old classic asp system to a OOP asp.net application. We are building the new application using a 3 tier arcitecture and i was wondering about the following. ...
0
by: grawsha2000 | last post by:
Greetings, I am developing this N-tier business app. The problem I'm facing is when I try to pass business objects (employees, dept..etc) from business tier to data tier,i.e., the add method in...
8
by: Charles Law | last post by:
This is a sort of pattern question, but relating to how components are coupled in a three-tier system. I have a presentation layer, business layer and data access layer, the first is the EXE,...
12
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.