473,396 Members | 1,754 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.

better way of using XML

hi all

I have a small application assembled from

C# winForm client side (few of them)

C# webService at the server side

I'm using xml file to transfer the GUI information from client to server

For Example in the client window there are 3 text box's and one button

Text boxes are "first num" , " second num" and "sum"

And "calc" button

So when the user click the "calc" button , the winForm window send the GUI
xml to the server , and the server parses the xml file and fill in the
records

Xml example :

<Gui_items>

<item>

<textbox name="first
num">30</textbox>

</item>

<item>

<textbox name="second
num">50</textbox>

</item>

<item>

<textbox
name="sum"></textbox>

</item>

</Gui_items>

the server response will be :

<Gui_items>

<item>

<textbox name="first
num">30</textbox>

</item>

<item>

<textbox name="second
num">50</textbox>

</item>

<item>

<textbox
name="sum">80</textbox>

</item>

</Gui_items>

Then the winForm client get the response XML and parses it ,

All GUI item's are filed in to the GUI controls

This only simple example, the real client window is much complex,

I'm using labels and label's color changing

Currently I'm parsing the XML file using System.Xml

Is there any way I can bind the GUI elements to this XML and make it easier
for me to develop it ?

Is there any way I can use dataset's and have the same goal ?

Please post any comment you have

Thank you very much

Sharon


Dec 5 '05 #1
2 1311
Hi Sharon,

I think you need to separate in your mind the GUI and the data that it
represents. The only data going to the Web Service should be business data.
The GUI can manage itself, and the Web Service doesn't have to know anything
about the GUI, only the data that it represents. Remember that the "U" in
GUI is "User," meaning that the GUI is for a human user, not for a business
class.

The GUI is supposedly getting its data from some sort of business layer of
business objects that actually do the work with the data, or it should be.
This type of layered design makes it easier to port from one sort of
interface to another (such as a Windows form to an ASP.Net app or a Console
App, for example). The GUI's job is to present data to a User, and to
receive input from the User.

As for the Web Service, it should be a set of SOAP Web Methods that are,
essentially, business methods. That is, these methods operate only on data,
receiving it, retrieving it, and manipulating it. It is possible, for
example, to create an application whose business classes are entirely Web
Services. The GUI simply talks to the Web Service by calling Web Methods, as
if it were talking to a local set of business objects and making method
calls to them.

This separation enables each logical "layer" to manage the business that is
its own, without any other layer having to know anything about that layer's
"personal" business. Or, as my Uncle Chutney sez, "a class should mind its
own business."

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.

"Sharon" <Sh*******@hotmail.com> wrote in message
news:uO****************@TK2MSFTNGP10.phx.gbl...
hi all

I have a small application assembled from

C# winForm client side (few of them)

C# webService at the server side

I'm using xml file to transfer the GUI information from client to server

For Example in the client window there are 3 text box's and one button

Text boxes are "first num" , " second num" and "sum"

And "calc" button

So when the user click the "calc" button , the winForm window send the GUI
xml to the server , and the server parses the xml file and fill in the
records

Xml example :

<Gui_items>

<item>

<textbox name="first
num">30</textbox>

</item>

<item>

<textbox name="second
num">50</textbox>

</item>

<item>

<textbox
name="sum"></textbox>

</item>

</Gui_items>

the server response will be :

<Gui_items>

<item>

<textbox name="first
num">30</textbox>

</item>

<item>

<textbox name="second
num">50</textbox>

</item>

<item>

<textbox
name="sum">80</textbox>

</item>

</Gui_items>

Then the winForm client get the response XML and parses it ,

All GUI item's are filed in to the GUI controls

This only simple example, the real client window is much complex,

I'm using labels and label's color changing

Currently I'm parsing the XML file using System.Xml

Is there any way I can bind the GUI elements to this XML and make it
easier
for me to develop it ?

Is there any way I can use dataset's and have the same goal ?

Please post any comment you have

Thank you very much

Sharon



Dec 5 '05 #2
Why don't you just create a serializable "UIState" class that you send to the
webservice via a Webmethod, and it sends you something similar back?
Then all you have to do is read the properties on the response class and do
whatever they say to your UI (Colors, values, etc).
Then you can set a WebReference to your WebService and you don't have to
parse any XML at all.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Sharon" wrote:
hi all

I have a small application assembled from

C# winForm client side (few of them)

C# webService at the server side

I'm using xml file to transfer the GUI information from client to server

For Example in the client window there are 3 text box's and one button

Text boxes are "first num" , " second num" and "sum"

And "calc" button

So when the user click the "calc" button , the winForm window send the GUI
xml to the server , and the server parses the xml file and fill in the
records

Xml example :

<Gui_items>

<item>

<textbox name="first
num">30</textbox>

</item>

<item>

<textbox name="second
num">50</textbox>

</item>

<item>

<textbox
name="sum"></textbox>

</item>

</Gui_items>

the server response will be :

<Gui_items>

<item>

<textbox name="first
num">30</textbox>

</item>

<item>

<textbox name="second
num">50</textbox>

</item>

<item>

<textbox
name="sum">80</textbox>

</item>

</Gui_items>

Then the winForm client get the response XML and parses it ,

All GUI item's are filed in to the GUI controls

This only simple example, the real client window is much complex,

I'm using labels and label's color changing

Currently I'm parsing the XML file using System.Xml

Is there any way I can bind the GUI elements to this XML and make it easier
for me to develop it ?

Is there any way I can use dataset's and have the same goal ?

Please post any comment you have

Thank you very much

Sharon



Dec 5 '05 #3

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

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
2
by: Amit D.Shinde | last post by:
Hello Experts.. I need some help regarding cookies and session objects and also global.asa file I am creating one cookie when a user logs in on my website. The cookie stores the login name of...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
24
by: Faith Dorell | last post by:
I really donīt like C.You can write better programs in BASIC than in C, if you donīt like this language. I donīt understand how C became so popular, although much better programming languages...
1
by: Xiangliang Meng | last post by:
Hi, all. Recently, I find there is a way in our project to maintain a global set in many files by using preprocessing directives. I'm wondering if we could find a better method for this. Many...
39
by: bazad | last post by:
Hi, I am not using C all the time. I have a general understanding of C and nothing else. The recent reply to use strlcpy and strlcat showed me that I am not aware of the best and safe...
3
by: Sai Kit Tong | last post by:
I posted for help on legacy code interface 2 days ago. Probably I didn't make it clear in my original mail. I got a couple of answers but none of them address my issues directly (See attached...
43
by: Rob R. Ainscough | last post by:
I realize I'm learning web development and there is a STEEP learning curve, but so far I've had to learn: HTML XML JavaScript ASP.NET using VB.NET ..NET Framework ADO.NET SSL
22
by: JoeC | last post by:
I am working on another game project and it is comming along. It is an improvment over a previous version I wrote. I am trying to write better programs and often wonder how to get better at...
23
by: mike3 | last post by:
Hi. (posted to both newsgroups since I was not sure of which would be appropriate for this question or how specific to the given language it is. If one of them is inappropriate, just don't send...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
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...

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.