Re: Design help.
- From: "John Sitka" <johnsitka@xxxxxxxxxxxxxxxxx>
- Date: Fri, 24 Nov 2006 13:29:09 -0500
Thank you, I'm not skilled enough to understand though.
"Claus Konrad [MCSD]" <ClausKonradMCSD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0E1035FE-D4CF-41A3-8311-92D8C3458D1F@xxxxxxxxxxxxxxxx
You are on the correct path!
The better design approach is to declare your interfaces first.
1) Declare interfaces
2) Implement this interface in your classes (C# class).
3) Implemtent the webservices classes from the same interface
4) In the WS, authenticate and authorize access to the business logic
implemented in your "true" classes (step 2).
Why?
Well - first of all it forces you to take a contract-first approach. Next it
allows you to call the logic from another "client" than the webservice that
exposes the methods. Second it de-couples the businss from the fact that it
is exposed as a webservices; not really a businnss entiity, is it?
Example:
public interfaces IOrder
{
string GetSomething(arguments...);
}
public class Order : IOrder
{
//..
}
[WebService]
public class OrderService : WebService, IOrder
{
[WebMethod]
public string GetSomething((arguments..)
{
//authorize
//if not allowed access - throw UnAuthorizedAccessException!
//instantiate businnss logic
//return data
}
}
--
rgds.
/Claus Konrad
MCSD.NET (C#)
"John Sitka" wrote:
Hi, sorry for a crosspost but that other news group was showing last post was a
week ago so I guess it dosen't see much use...
I'm about to start a solution and I'm curious about the approach of a webservices project.
Should the objects be represented in classes such as...
public class Orders (ie Orders.cs) within a project
and then have the service be in a class like OrdersService.asmx
public class OrdersService : System.Web.Services.WebService
and this class contain only [WebMethod] 's
I guess another another way to ask the same question is..
Would it be less desireable if a class inheriting System.Web.Services.WebService
contain methods that are not [Web Method]
.
- Follow-Ups:
- Re: Design help.
- From: Claus Konrad [MCSD]
- Re: Design help.
- References:
- Design help.
- From: John Sitka
- RE: Design help.
- From: Claus Konrad [MCSD]
- Design help.
- Prev by Date: IsNullable:=true in Proxy class
- Next by Date: Re: Design help.
- Previous by thread: RE: Design help.
- Next by thread: Re: Design help.
- Index(es):
Relevant Pages
|