473,503 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What type of return to use between layers

My business object (BO) need to pass a table to the GUI. The BO and the
GUI will reside on the same computer and will not use .NET remoting or
web service for now, but will need to support .NET remoting and a web
interface in the future. What return type should I use?

1) DataSet
2) DataTable
3) XML

With the first 2 options, does .NET do the plumbing of transfering the
table in XML format between the layers or it simply pass the object?

With the XML option, do you define the return type as string? How do you
return the XML with the XSD?

TIA
Jul 21 '05 #1
2 1307
Are these just different objects running in the same process? If so,
there is no need to do any "plumbing" to transfer to/from XML between
the layers (since the layers are really just logical).

If you want to send XML that is defined by an XSD, you probably want to
use a typed DataSet. The framework will handle the serialization to XML
and back.

You can also use your own custom collection types, with the appropriate
serialization attributes - no need for a DataSet.

I would definitely not return data as a String data type if it really
contains structured data.

But remember - you only need to serialize to XML if you are transferring
data out of process.

Joshua Flanagan
http://flimflan.com/blog

Sylvain Larin wrote:
My business object (BO) need to pass a table to the GUI. The BO and the
GUI will reside on the same computer and will not use .NET remoting or
web service for now, but will need to support .NET remoting and a web
interface in the future. What return type should I use?

1) DataSet
2) DataTable
3) XML

With the first 2 options, does .NET do the plumbing of transfering the
table in XML format between the layers or it simply pass the object?

With the XML option, do you define the return type as string? How do you
return the XML with the XSD?

TIA

Jul 21 '05 #2
Thanks Joshua. The objects are running in the same process for now, but
they will be in a distributed architecture (.NET remoting) for the next
version.

There is also a chance that the BO may be accessed with web service
and/or a GUI other than .NET in the future. In that scenario, would
returning a DataSet still be wise?

Sylvain

Joshua Flanagan wrote:
Are these just different objects running in the same process? If so,
there is no need to do any "plumbing" to transfer to/from XML between
the layers (since the layers are really just logical).

If you want to send XML that is defined by an XSD, you probably want to
use a typed DataSet. The framework will handle the serialization to XML
and back.

You can also use your own custom collection types, with the appropriate
serialization attributes - no need for a DataSet.

I would definitely not return data as a String data type if it really
contains structured data.

But remember - you only need to serialize to XML if you are transferring
data out of process.

Jul 21 '05 #3

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

Similar topics

54
6500
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO...
5
8884
by: yoelgold | last post by:
hi can someone please tell me what "document.MM_sr" is. I tried searching for a explanation on the web but cant find anything. What does MM_sr represent? and where can i get documentation on it. ...
10
54840
by: InvisibleMan | last post by:
Hi, Thanks for any help in advance... Okay, I have the JS listed below that calls for the display of the (DIV) tag... cookie function not included, as don't feel its necessary but you'll get the...
6
6064
by: John Salerno | last post by:
I understand how they work (basically), but I think maybe the examples I'm reading are too elementary to really show their value. Here's one from Programming C#: #region Using directives ...
19
2864
by: Charles Law | last post by:
Take a solution with a project hierarchy along the lines of an n-tier system, so that we have a data layer, business layer and presentation layer. The presentation layer is coupled to the business...
2
290
by: Sylvain Larin | last post by:
My business object (BO) need to pass a table to the GUI. The BO and the GUI will reside on the same computer and will not use .NET remoting or web service for now, but will need to support .NET...
1
3867
by: mudasserrafiq | last post by:
I am using following asp file default.asp <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <META http-equiv=Content-Type content="text/html; charset=windows-1252"> <META content="0...
123
6310
by: plenty900 | last post by:
I was looking over someone's C++ code today and despite having written perfectly readable C++ code myself, the stuff I was looking at was worse than legalese. The people who are guiding the...
9
1773
by: jeddiki | last post by:
Hi, I am using some javascript to produce a new window for my account info. It is designed to be opened looked at and then closed again. But apparently the code is a bit old fashioned...
0
7261
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,...
1
6974
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
7445
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
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4665
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...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.