473,396 Members | 1,864 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,396 software developers and data experts.

Returning Business Entities From Web Services

Hi

I in the process of redesigning an existing VB6 app and moving it to VB.NET
2005. At the moment I am just trying to get the architecture right but have
hit a problem that I cant find a satisfactory answer to.

Suppose I have a "MyClassLibrary.Client" class containing some business logic

Public ReadOnly Property Age() As Integer
Get
Age = DateDiff(DateInterval.Year, Dob, DateTime.Today)
End Get
End Property

When i have a webservice that returns type "MyClassLibrary.Client" the type
that I get back at the clientside is "MyWebService.Client". I understand the
reasons behind this but, what I cant find/think of a suitable way around it.

I could do this
Public Function ConvertClient(ByVal WS As MyWebService.Client) As
MyClassLibrary.Client

dim Client as New MyClassLibrary.Client

Client.Forename = WS.Forename
Client.Surname = WS.Surname
.........etc
return Client
End Function

but this is messy and prone to bugs, Its too easy to add a new property to
the class but forget to include it in the conversion routine

Or I have read that you can edit the autogenerated code to get the object
you want, but that you will lose your changes should you update the web
reference.

Neither of these looks very good to me.

Has anyone else come up against the same issue?
How did you get round it?
Is there a recommended way of doing this?

Cheers

--
David Steele
Recent VB6 - Dot net convert
Nov 19 '05 #1
0 893

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

Similar topics

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...
12
by: apoc69 | last post by:
hi people, i got stucked in my project and i just dont know how to continue. it's about puting business entities into the UI (web). first some simple example code how an entity looks like in...
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...
16
by: MS newsgroup | last post by:
I don't have clear reasons why we need business logic layer and data logic layer instead of having only data logic layer. Are there any good reasons for that?
25
by: Penelope Dramas | last post by:
Hello, I'm in a front of very serious .net redesign/rewrite of an old VB6 application. I had been asked to make it .NET 2.0 and would like to ask couple of questions regarding data access as...
15
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 ...
2
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...
2
by: Andrus | last post by:
Winforms UI assembly has static FormManager.FormCreator method which creates forms taking entity as parameter. I need to pass this method to business objects in business assembly so that business...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...

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.