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

Some basic questions

Hi all, I have some basic WebService questions

#1
Let's say I have a business class named "Customer". The customer would be
able to log in and update their personal information like so

void UpdateCustomerInformation(Customer customer)

changing information such as their telephone number etc. Now the customer
class would have information in it such as "Decimal CreditLimit". This
should not be modifyable by the customer but only by a sales manager.
Should I ignore this setting if the current user is not a SalesManager, or
should I have two different methods that accept two different types of
parameter?
#2
On a similar subject to #1, what if a customer can see all of their own
information (CreditLimit for example) but only look up a subset of
information about other customers? Instead of returning concrete types like
Customer would it be a good or bad idea for my WebMethods to pass
pre-defined XML back and forth? For example

void UpdateCustomer(string customerXml)
string GetCustomerInformation(Guid customerId)
I appreciate any help/comments
Pete
Apr 10 '06 #1
4 1308
"Peter Morris [Droopy eyes software]" <pete@droopyeyes[dot]comREMOVETHIS>
wrote in message news:Or**************@TK2MSFTNGP03.phx.gbl...
Hi all, I have some basic WebService questions

#1
Let's say I have a business class named "Customer". The customer would be
able to log in and update their personal information like so

void UpdateCustomerInformation(Customer customer)

changing information such as their telephone number etc. Now the customer
class would have information in it such as "Decimal CreditLimit". This
should not be modifyable by the customer but only by a sales manager.
Should I ignore this setting if the current user is not a SalesManager, or
should I have two different methods that accept two different types of
parameter?
#2
Instead of returning concrete types like Customer would it be a good or
bad idea for my WebMethods to pass pre-defined XML back and forth?


Hi Pete,

For the first choice I would go with one method that does the work depending
on the given permissions. However it is pretty relative and your mileage may
vary.
For the second option I would definitely go for returning specific types
instead of predefined xml. In fact the custom types also produce predefined
xml, but you use strong type objects in your code and the built in
serialization in .NET framework.

Regards,

--
Martin Kulov
http://www.codeattest.com/blogs/martin

MVP, MCT, MCSD.NET Early Achiever
Apr 10 '06 #2
Hi Martin
For the first choice I would go with one method that does the work
depending on the given permissions. However it is pretty relative and your
mileage may vary.
Okay....

For the second option I would definitely go for returning specific types
instead of predefined xml. In fact the custom types also produce
predefined xml, but you use strong type objects in your code and the built
in serialization in .NET framework.


I once had a system where

A) A customer can view all of their own information
B) An account manager for that customer can only see some of that
information
C) Any other account manager can see less than B
D) Anonymous users can see less than C

This also applied to employees of the customer, members of the employees'
families, etc. The reason I was reluctant to go down this route was that I
would end up with 4 classes per business class.

Are there any big disadvantages to the XML approach? I was thinking that it
would be easy to convert to HTML for a start.
Thanks very much for your input!
Pete
Apr 11 '06 #3
"Peter Morris [Droopy eyes software]" <pete@droopyeyes[dot]comREMOVETHIS>
wrote in message news:ei**************@TK2MSFTNGP04.phx.gbl...
I once had a system where

A) A customer can view all of their own information
B) An account manager for that customer can only see some of that
information
C) Any other account manager can see less than B
D) Anonymous users can see less than C

This also applied to employees of the customer, members of the employees'
families, etc. The reason I was reluctant to go down this route was that
I would end up with 4 classes per business class.

Are there any big disadvantages to the XML approach? I was thinking that
it would be easy to convert to HTML for a start.


The most major disadvantage that I see is that you are not going to use
strong typed infoset and this could lead to hard to diagnose runtime errors.
Using four different business classes will only lead to more maintenance
work, but on the wire data will be send also in XML.
However if you have too many business classes this maintenance work could be
a lot, so may be you can check each property access for required
permissions.
Still using raw XML is an option. Just make sure to build appropriate
diagnose tools so you can locate problems in advance.

Regards,
Martin

Apr 11 '06 #4
> The most major disadvantage that I see is that you are not going to use
strong typed infoset and this could lead to hard to diagnose runtime
errors. Using four different business classes will only lead to more
maintenance work, but on the wire data will be send also in XML.
However if you have too many business classes this maintenance work could
be a lot, so may be you can check each property access for required
permissions.
Still using raw XML is an option. Just make sure to build appropriate
diagnose tools so you can locate problems in advance.


I was thinking of including a data version in each XML response, I think
that should be enough don't you?
Apr 13 '06 #5

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

Similar topics

2
by: AK | last post by:
I don't want any part of the previous discussion on Visual Basic versus Visual Basic.Net. My query is about using Visual Basic for Applications; and whether it is better to use Visual Basic 6 or...
2
by: Steven O. | last post by:
First, this may not be the correct newsgroup. I have some relatively basic questions on SQL. I tried to find a newsgroup that was specifically just about SQL, and was surprised to find that all...
7
by: Steven O. | last post by:
I am basically a hobbyist programmer, at the moment doing a little work experimenting with some AI stuff. I learned C++, and then tried to teach myself MFC using MS Visual C++ 6.0. I swore off of...
12
by: Vibhajha | last post by:
Hi friends, My sister is in great problem , she has this exam of C++ and she is stuck up with some questions, if friends like this group provides some help to her, she will be very grateful....
193
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I...
1
by: danilo of TUP | last post by:
Greetings, im Danilo, a student from TUP Manila and taking up COMPUTER SCIENCE. we are going to have a defense or we could say a project in turbo c. i just wanna know how to use the SWITCH...
3
by: aziz001DETESTSPAM | last post by:
I've been following some tutorials and reading books and have a basic grasp of the fundamental ADO.NET commands. But all the books I've read use a database with only 1 table. My database has many,...
2
by: Water Cooler v2 | last post by:
I've not touched SQL server programming since 1999. I have very little memory of it and need some clarifications on some basic questions that I could even use a book for. Until I get myself a good...
0
by: software2006 | last post by:
ASP And Visual Basic Interview questions and answers I have listed over 100 ASP and Visual Basic interview questions and answers in my website...
3
by: alcapoontje | last post by:
hi there, i'm already searching the internet for a couple of days to find an answer on this (simple) questions but i couln't find anything usefull. - how to quit and open a programm like "word" with...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
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...

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.