472,981 Members | 1,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,981 software developers and data experts.

Web Services/SOA

Hello.

This post is long, but I think that's a pertinent question for many people.

I built a client/server application using .NET and SQL server, a 2 tier
application. This first version was built in a rush, so its architecture is
not well designed for the company growth.

Some weeks ago, I decided to separate the data from the presentation tier
and include the so named Business Logic Layer. This is a pretty name. and I
can understand pretty well its value. My goal is to facilitate the change of
processes, with transparency to the client. This is one of the
interpretations of SOA.

What did I use for this layer? Web Services. This WS access database through
the call of Stored Procedures. My headaches started here. Is this a good
solution?

I read and I'm still reading several points of view. the are a lot of
opinions J

Concerning the technology used, I am also very confused. This company has
several connected processes. So I built a single class in a WS with several
methods (business services), so those processes can connect through the use
of those services/methods.

For instance I have a CAR. There's a method to get car data from database,
and another one to update car data. Two methods. You will say: use a CAR
OBJECT with appropriate methods. That's were I have some doubts. I can only
have one class in a web service, right? At least, that's what WS config
says:

<%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs"
Class="Service" %>

What are the best practices? Where can I find better resources for this kind
of development?

Thanks in advance. Sorry the long post.

Regards,

Marco
Jun 27 '08 #1
4 1876
Unfortunately, I think you can ask this question to 3 developers and get
12 different answers... it isn't a simple "do it this way" area...
For instance I have a CAR. There's a method to get car data from database,
and another one to update car data. Two methods. You will say: use a CAR
OBJECT with appropriate methods. That's were I have some doubts. I can only
have one class in a web service, right?
The actual service (the concrete provider of the SOA interface) can only
be a single class, but it can offer methods that accept/return many
other classes - so your (making stuff up) FleetService might have a "Car
GetCar([sometype] key)" method and a "? UpdateCar([sometype] key)" method.

Re methods, well you have o use methods at some point either way; I
guess the question is whether these are methods of the car vs methods of
the service. I prefer the latter as it makes it clear when I am crossing
boundaries (which may have a performance hit) - where-as with an
instance method it isn't clear whether it operates locally or over the
service.

If you are consuming several services from the same client, then with
asmx you might want to look at "sharetypes" (wsdl.exe) to allow you to
use the same Car against different services (otherwise each will be
different).

Note that you might want to look at WCF in preference asmx... it offers
various advantages (I'm not going to attempt to list them all, but the
fact that data is more contract-based is a biggie). If you choose (it
isn't the only approach) you can even use assembly sharing to have the
same Car type at the client (rather than just a lightweight version) -
but this depends on running .NET etc at the client.

You might also wish to look at "ADO.NET Data Services" (not yet
released) which allows access over a web-service to LINQ objects
(IQueryable<T>) - in particular LINQ-to-SQL and LINQ-to-entities. Just
another option...

Marc
Jun 27 '08 #2

"Marco Pais" <marco.pais[at]gmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hello.

This post is long, but I think that's a pertinent question for many
people.

I built a client/server application using .NET and SQL server, a 2 tier
application. This first version was built in a rush, so its architecture
is not well designed for the company growth.
>
Some weeks ago, I decided to separate the data from the presentation tier
and include the so named Business Logic Layer. This is a pretty name. and
I can understand pretty well its value. My goal is to facilitate the
change of processes, with transparency to the client. This is one of the
interpretations of SOA.
<http://www.google.com/search?hl=en&pwst=1&sa=X&oi=spell&resnum=0&ct=resu lt&cd=1&q=books+on+soa+architecture&spell=1>

You need to find a good book to start with and understand the concepts of
SOA.

You need to think about this very carefully, as I just came off of a SOA WCF
solution that was a total nightmare that was not transparent to the client
and didn't allow for new clients being implemented and using the SOA
solution easily with growth. The solution was not thought out well, a total
nightmare to maintain or implement new enhancements -- a total nightmare,
and it showed what not to do.
>
What did I use for this layer? Web Services. This WS access database
through the call of Stored Procedures. My headaches started here. Is this
a good solution?
Well, you can have problems in getting that data to/from the UI/Bus/WS/Data
access tiers, and again you need to think about how you're going to do this.
You might want to look at something like nHibernate or other such tools to
faciliate data acess and/or with native calls to SQL server too. And you can
still use Strored Procedures with both solutions.
>
I read and I'm still reading several points of view. the are a lot of
opinions J
Java was here first, which has many books on SOA that can be applied to .Net
too as a starting point on how to do things, along with .Net books as well.
You need to find some good books that will give you a good concept.
>
Concerning the technology used, I am also very confused. This company has
several connected processes. So I built a single class in a WS with
several methods (business services), so those processes can connect
through the use of those services/methods.
What's stopping you from having more than one WEb service? The Web service
should only be the means of sending data between the BUS and DAL tiers to
begin with by the use of serialised objects between the tiers.
>

For instance I have a CAR. There's a method to get car data from database,
and another one to update car data. Two methods. You will say: use a CAR
OBJECT with appropriate methods. That's were I have some doubts. I can
only have one class in a web service, right? At least, that's what WS
config says:
You use serialized XML objects, which can be in a binary format --
serialize/deserialize objects. The objects contain their on properties and
methods that will be acted upon.
>
<%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs"
Class="Service" %>

What are the best practices? Where can I find better resources for this
kind of development?
Look above and use Google. You'll find the books.

I also would suggest looking into MVP. You should think interfaces, and the
UI should be unaware of the bussiness layer - a loosly coupled solution,
which allows for easy testing, implementation and growth of the solution.
You can use a test harness and you test against the interfaces.

MODEL-VIEW-PRESENTER

http://www.polymorphicpodcast.com/

click 'Shows'

click 'Design Patterns Bootcamp: Model View * Patterns*

view parts 1-5

You can use Google to get more information about this or find books.
You may want to get the book, download the CSLA framework code, and download
the project code that uses the CSLA framework to get concepts. It's got all
that you're looking for to learn on the howto(s) in many areas. As a matter
of fact, I came off a WS SOA project that used CSLA which is free to
implement in a company. You just can't develop a solution using CSLA as sale
the solution using CSLA.

http://www.lhotka.net/

Jun 27 '08 #3
Marco Pais wrote:
I built a client/server application using .NET and SQL server, a 2 tier
application. This first version was built in a rush, so its architecture is
not well designed for the company growth.

Some weeks ago, I decided to separate the data from the presentation tier
and include the so named Business Logic Layer. This is a pretty name. and I
can understand pretty well its value. My goal is to facilitate the change of
processes, with transparency to the client. This is one of the
interpretations of SOA.

What did I use for this layer? Web Services. This WS access database through
the call of Stored Procedures. My headaches started here. Is this a good
solution?
No.

SOA is about exposing services. Web service calls used between the
business logic layer in one app and the business logic layer in
another app.

Web services are not in general suitable for presentation
layer - business logic layer or business logic layer - data
access layer.
Concerning the technology used, I am also very confused. This company has
several connected processes. So I built a single class in a WS with several
methods (business services), so those processes can connect through the use
of those services/methods.
A service will consist of a single class that offers one or more
methods.
For instance I have a CAR. There's a method to get car data from database,
and another one to update car data. Two methods. You will say: use a CAR
OBJECT with appropriate methods. That's were I have some doubts. I can only
have one class in a web service, right? At least, that's what WS config
says:
As explained above then GetCar and SaveCar is usually not a good
service.

The car app does all the basic CRUD stuf internally and
expose a service to other apps for stuff like getting values
to the accounting app and reserve car for employee in the
HR app.

Arne
Jun 27 '08 #4
Hi there.

First of all, thanks for all the replies.

Security is one of my worries. For instance, I have some kind of portal over
Apache/PHP/MySQL. From my intranet (.NET/WS/SQL Server), I need to access
some data and I thought about Web Services (XML). Concerning security, I am
worried, of course. SOA is a nice concept, but when it comes to the
implementation, I guess things start to complicate.

When I decided for one Web Service / several Methods instead several Web
Services, each one with several methods, I thought about sharing data
between objects / methods and also thought about security. only one WS
available.

I will read more. I also think that I must spend more time investigating the
best approach, although, again, there are not "best solutions". I think this
still a very abstract matter.

Thanks again.

Marco
"Marco Pais" <marco.pais[at]gmail.comescreveu na mensagem
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hello.

This post is long, but I think that's a pertinent question for many
people.

I built a client/server application using .NET and SQL server, a 2 tier
application. This first version was built in a rush, so its architecture
is not well designed for the company growth.

Some weeks ago, I decided to separate the data from the presentation tier
and include the so named Business Logic Layer. This is a pretty name. and
I can understand pretty well its value. My goal is to facilitate the
change of processes, with transparency to the client. This is one of the
interpretations of SOA.

What did I use for this layer? Web Services. This WS access database
through the call of Stored Procedures. My headaches started here. Is this
a good solution?

I read and I'm still reading several points of view. the are a lot of
opinions J

Concerning the technology used, I am also very confused. This company has
several connected processes. So I built a single class in a WS with
several methods (business services), so those processes can connect
through the use of those services/methods.

For instance I have a CAR. There's a method to get car data from database,
and another one to update car data. Two methods. You will say: use a CAR
OBJECT with appropriate methods. That's were I have some doubts. I can
only have one class in a web service, right? At least, that's what WS
config says:

<%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs"
Class="Service" %>

What are the best practices? Where can I find better resources for this
kind of development?

Thanks in advance. Sorry the long post.

Regards,

Marco


Jun 27 '08 #5

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

Similar topics

4
by: rbt | last post by:
How does one associate a "Description" with a Windows service written in Python? I've just started experimenting with Python services. Here's my code... copied straight from Mr. Hammond's "Python...
6
by: cs | last post by:
I noticed there is some .net services on my winxp. One or two mention the CLR. Does that mean that my .net apps/services wont run before those services start? I need to run my service as early on...
0
by: Diego F. | last post by:
I've been days with that. I'm trying to work with web services sending and returning objects, and the web service must store some objects. - My first try (the most obvious in my opinion) was to use...
26
by: Mr Newbie | last post by:
What do I need to run a web service on my PC ? I know I need the .NET Framework, but do I need IIS Running ?
3
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types...
7
by: Stu | last post by:
Hi, I have a web service which returns a record set and works well integrated with an asp dot net page. However if I decided to develop a unix app will i be able to read the dataset as it is...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
2
by: sdstraub | last post by:
I have created 5 services in my project, in the 1st service I set servicestorun = array of all 5 services, I have a project installer with 5 service installers, one for each service. I have code...
0
by: krishnaraju | last post by:
HI to all, please help me.its urgent requirement. my question is this is the wsdl file i got from our client.please see at bottom. when iam trying to access that webmethods iam getting...
1
by: Data Entry Outsourcing | last post by:
Data Entry plays vital role in every business area. Data Entry is one such aspects of any business that needs to be handled properly for expanding your business. Data Entry is one of the leading...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.