473,408 Members | 1,728 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,408 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 2614
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.