473,503 Members | 1,650 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 1308
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
6502
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
8886
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
54842
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
6311
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
7202
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
7084
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
7278
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
7328
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...
1
6991
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
7458
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
4672
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...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
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.