WebService Design pattern

Hello everyone,I'm working with a WEbService using Axis1 generated client code.Can anybody give me a good linkg to a Design pattern to use such generated code.Regards,Sebastien Degardin
[221 byte] By [sdegardina] at [2007-11-26 20:03:44]
# 1

> Hello everyone,

>

> I'm working with a WEbService using Axis1 generated

> client code.

>

> Can anybody give me a good linkg to a Design pattern

> to use such generated code.

>

> Regards,

> Sebastien Degardin

no. design patterns are not requirements docs. this is a bit like saying "I've built a kit car, can anyone tell me where to drive to?"

georgemca at 2007-7-9 23:03:38 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

I know that.

I just wanted to get guidelines for Axis Generated code.

Of course, creating the request / reponse and others is boilerplate code, in this case, there are probably "Design pattern" for such case.

I'm going to start by working with something like a Factory to create the the request objects and fill them with the required data.

Then probably another Object to check every response status and data.

Regards,

Sebastien Degardin.

sdegardina at 2007-7-9 23:03:39 > top of Java-index,Other Topics,Patterns & OO Design...
# 3

Object-oriented design patterns are tools that are used for designing object-oriented software. If you were utilizing object-oriented design patterns properly you would have already used them way before choosing to use a WEbService and before choosing to use Axis1 technology.

You are attempting to put the cart in front of the horse and are wondering why the horse has not started pulling the cart.

Object-oriented design patterns do not provide guidelines for working with any specific technologies such as as Axis, EJB, JMS, JAXP, etc. They are guidelines for designing software. Once there is a design in place for the application, then you start to figure out how to implement the design and then you start to pick specific technologies and API's such as Axis, EJB, JMS, etc.

You end up having two designs. One is the high-level software design using UML, design patterns, diagrams, etc. The second, is the lower-level implementation (technical) design which specifies the specific technologies and APIs. We are going to use Tomcat for this, EJB for that, JMS for this, a web service for that, and so forth and so on. To use object-oriented design patterns effectively, it is very important to undertand this point.

GhostRadioTwoa at 2007-7-9 23:03:39 > top of Java-index,Other Topics,Patterns & OO Design...
# 4

I have to use webservices since I'm working for a large company project. (we don't always choose that, sorry !).

I KNOW what's design patterns.

And for any technologies, there are design patterns.

There are Design pattern for each part of an application.

Am I asking for OBJECT-ORIENTED design pattern ? NO, i'm aking for a design pattern for maximun reusability and scalabilty in a particular piece of my project wich is the WebService Integration Layer.

Design Pattern are not Only related to OO Modeling.

But for any thing you want !!!!!

Regards,

Sebastien Degardin

sdegardina at 2007-7-9 23:03:39 > top of Java-index,Other Topics,Patterns & OO Design...
# 5
> And for any technologies, there are design patterns.That's not true.
dcmintera at 2007-7-9 23:03:39 > top of Java-index,Other Topics,Patterns & OO Design...
# 6

I don,'t fully agree with that.

Patterns and Pattern Languages are ways to describe best practices, good designs, and capture experience in a way that it is possible for others to reuse this experience.

So, in my case, i think there should be best or good practices which have been captured by experience with WebService and Axisv or other auto-generated code which would provide reusabilityn, scalability and ....

For me Design pattern are applicable for a lot a things in a lot of domains.

Regards,

Sebastien Degardin

sdegardina at 2007-7-9 23:03:39 > top of Java-index,Other Topics,Patterns & OO Design...
# 7

> I don,'t fully agree with that.

fine. why bother asking questions if you're just going to disagree with the answers that don't match up with your own?

> Patterns and Pattern Languages are ways to describe

> best practices, good designs, and capture experience

> in a way that it is possible for others to reuse this

> experience.

you specifically asked about design patterns. more specifically, webservice design patterns

> So, in my case, i think there should be best or good

> practices which have been captured by experience with

> WebService and Axisv or other auto-generated code

> which would provide reusabilityn, scalability and

> ....

>

> For me Design pattern are applicable for a lot a

> things in a lot of domains.

good for you. but remember that "for me" is not necessarily the same as "in reality"

georgemca at 2007-7-9 23:03:39 > top of Java-index,Other Topics,Patterns & OO Design...
# 8

> > I don,'t fully agree with that.

>

> fine. why bother asking questions if you're just

> going to disagree with the answers that don't match

> up with your own?

Because, i aksed a question, nobody give me an answer.

They, you, just contested the question, not trying to respond.

That's why I don't FULLY agree.

>

> > Patterns and Pattern Languages are ways to

> describe

> > best practices, good designs, and capture

> experience

> > in a way that it is possible for others to reuse

> this

> > experience.

>

> you specifically asked about design patterns.

> more specifically, webservice design patterns

I said, i USE WebService with Axis, and asked for Design pattern for such case. not asked for desicion about design pattern.

A design pattern for Axis generated code is possible.

Of course, i found a way to use a generic mechanism to centralize the request creation, request call and response validation.

This avoid boilerplate code in each method call.

But, that said, i don't have so much experience with that, that's why i asked for another example ...

>

> > So, in my case, i think there should be best or

> good

> > practices which have been captured by experience

> with

> > WebService and Axisv or other auto-generated code

> > which would provide reusabilityn, scalability and

> > ....

> >

> > For me Design pattern are applicable for a lot a

> > things in a lot of domains.

>

> good for you. but remember that "for me" is not

> necessarily the same as "in reality"

If you take EJB 2.1 and DTO, they are not always seen as good practices.

But, however, they are books which related Design Pattern for such technologies, and they don't talk about the desicion of choosing EJB or NOT.

I gave a context and ask for design in such context.

sdegardina at 2007-7-9 23:03:39 > top of Java-index,Other Topics,Patterns & OO Design...
# 9

> > > I don,'t fully agree with that.

> >

> > fine. why bother asking questions if you're just

> > going to disagree with the answers that don't

> match

> > up with your own?

>

> Because, i aksed a question, nobody give me an

> answer.

> They, you, just contested the question, not trying to

> respond.

> That's why I don't FULLY agree.

there is no answer to your question. a design pattern won't tell you how to use generated code. a design pattern might help in using specific generated code, but that's not what you asked. we can't second-guess what your code looks like, and what you need to achieve with it

> >

> > > Patterns and Pattern Languages are ways to

> > describe

> > > best practices, good designs, and capture

> > experience

> > > in a way that it is possible for others to reuse

> > this

> > > experience.

> >

> > you specifically asked about design

> patterns.

> > more specifically, webservice design patterns

> I said, i USE WebService with Axis, and asked for

> Design pattern for such case. not asked for desicion

> about design pattern.

see above reply. design patterns are not magic beans that can be applied to any problem. especially, not to vague problems like this one

> A design pattern for Axis generated code is

> possible.

you're telling me there is a "use axis code" pattern? there isn't, any more than there is a general-purpose recipe for chefs. if you think there is, lots of luck tracking it down.

> Of course, i found a way to use a generic mechanism

> to centralize the request creation, request call and

> response validation.

>

> This avoid boilerplate code in each method call.

>

> But, that said, i don't have so much experience with

> that, that's why i asked for another example ...

>

> >

> > > So, in my case, i think there should be best or

> > good

> > > practices which have been captured by experience

> > with

> > > WebService and Axisv or other auto-generated

> code

> > > which would provide reusabilityn, scalability

> and

> > > ....

> > >

> > > For me Design pattern are applicable for a lot a

> > > things in a lot of domains.

> >

> > good for you. but remember that "for me" is not

> > necessarily the same as "in reality"

>

> If you take EJB 2.1 and DTO, they are not always seen

> as good practices.

> But, however, they are books which related Design

> Pattern for such technologies, and they don't talk

> about the desicion of choosing EJB or NOT.

what are you talking about? the DTO pattern solves - sort-of - a specific problem that often arises while using EJB, for example. it's not a "how to use EJB" pattern

georgemca at 2007-7-9 23:03:39 > top of Java-index,Other Topics,Patterns & OO Design...
# 10

Let's say,

1000 peoples in different projects used Axis1 code.

This code has to be used in Services like DAO, Facade, ...

The orchestration of this code can be done in different ways.

With the experience, there is probably a good/best way which is highlighted, this is of course a Design Pattern.

I don't think my question was so stupid.

Do you think ?

sdegardina at 2007-7-9 23:03:40 > top of Java-index,Other Topics,Patterns & OO Design...
# 11

> Let's say,

>

> 1000 peoples in different projects used Axis1 code.

> This code has to be used in Services like DAO,

> Facade, ...

>

> The orchestration of this code can be done in

> different ways.

>

> With the experience, there is probably a good/best

> way which is highlighted, this is of course a Design

> Pattern.

>

> I don't think my question was so stupid.

> Do you think ?

first off, that's somewhat different to your original question don't you think? and second, no, I don't see that a design pattern will help there. design patterns solve specific problems, they don't solve general problems like "how to use a particular technology". I don't think your question is stupid, I just think it's misguided. not everything can be solved with a design pattern. to think otherwise is folly. you're talking about a cross-cutting problem - "how do I use generated code?" - rather than an orthogonal problem - "how can I notify other objects of changes?". I don't think your question is stupid, but I do think you're thinking of the wrong terminology, and the wrong solution

what are you trying to achieve?

georgemca at 2007-7-9 23:03:40 > top of Java-index,Other Topics,Patterns & OO Design...
# 12

I have a good knowledge about design pattern and design pattern related to J2EE.

I "would" say that what i'm looking for is a Design pattern "Behavioral".

Axis Generate the following code :

- Request / Response Object for each operation (about 10 for my case)

- Interface for calling the Operation

- Implementation of the Method call and other WS specific mechanism.

I'm going to integrate this WS as a Facade in my Application Layer.

for each request, i could do :

CustomerRequest request = new Request();

CustomerModel model = new CustomerModel();

CustomerResponse response = null;

model.setCustomerID('001');

request.setModel(customerModel);

response = this.wsService.getCustomer(request);

//validate the response and handle Exception

For each operation provided by the WS if have to do that.

So, i wanted to find a way to centralize the Call of the WS and request creation.

So that i can concentrate on a good Response (Exception) handling.

Isn't it good to do that instead of handling the WS response ain each method ?

Regards,

Sebastiendeg

sdegardina at 2007-7-9 23:03:40 > top of Java-index,Other Topics,Patterns & OO Design...
# 13
experience has taught me not to bother continuing a conversation in which the other party constantly re-defines his questions/terms in order to make someone else "wrong"
georgemca at 2007-7-9 23:03:40 > top of Java-index,Other Topics,Patterns & OO Design...
# 14

Sorry,

I'm not trying to make you wrong.

I was trying and used the term "WOULD" to mark the conditional.

In my last post, i explain WHY i called that a Design pattern and i didn't try to make you wrong.

And, i agreed with the fact the my question was not probably 100% clear.

But, let's stop this.

sdegardina at 2007-7-9 23:03:40 > top of Java-index,Other Topics,Patterns & OO Design...
# 15

> 1000 peoples in different projects used Axis1 code.

> This code has to be used in Services like DAO,

> Facade, ...

DAO and Facade are object-oriented design patterns. The "Services" would be designed with object-oriented design patterns, and the design would be implemented with Axis code.

> With the experience, there is probably a good/best

> way which is highlighted, this is of course a Design

> Pattern.

Here is where you are off a bit.

Using object-oriented design patterns is a best practice, or, a good/best way to design software.

Good/best way to do something with code is not a design pattern.

In today's software industry, the term "design pattern" is a short way of saying "object-oriented design pattern". There is a specific, known understanding of what a "design pattern" is. Your definition is not correct. Design patterns, frameworks, and best practices are different concepts.

> I don't think my question was so stupid.

> Do you think ?

No, your question was not stupid. You just were using the wrong terminology and this causes confusion and misunderstanding.

You would have avoided this confusion if you has asked something like, "what are the best practices for using Axis code and web services?"

Or, "what is the good/best way for dealing with Axis code?"

GhostRadioTwoa at 2007-7-21 17:50:02 > top of Java-index,Other Topics,Patterns & OO Design...