问题描述:

I want to create a web service (SOAP) under Apache Tomcat with Axis2, and I must respect the three-tiered architecture:

DAO -> Business Logic Layer -> Presentation Layer

I'm new to web services. Is there a step-by-step tutorial for this?

网友答案:

There isn't really a presentation layer in a web service, unless you consider the service itself to be the presentation layer.

http://www.roseindia.net/webservices/axis2/

There is tons of DAO information on the web, and there's nothing special about a DAO layer for a service versus any other application. A lot of this will depend upon how you want to build your DAO layer. I like using Spring JDBC.

网友答案:

Three tiered architecture means different things to different people.

One common interpretation is (with tiers from the user starting with #1):

  1. Presentation layer running in the browser. I.e. Javascript (possibly from some framework such as jQuery, GWT, etc).
  2. Business Logic layer running on the server. I.e. A dynamic web server (Tomcat in this case)
  3. Database such as MySQL, SqlServer, Oracle, PostgreSql, etc.

It's also possible to have a layer #2.5 doing the DAO work for you (or a custom DAO) such as Hibernate.

Another interpretation is that #1 is actually the web server, and #2 is a separate business logic server, where #1 and #2 live in separate server instances (likely on separate machines or VMs) for security, isolation, and the ability to scale and release separately (and many other motivations).

In any case, you should read up on typical Java serving architectures and possibly describe your goals better. I.e. you use "Presentation Layer" which in some definitions doesn't make sense for a non-UI based web service. Of course, Axis2 could be your "presentation layer" for a web service as well :)

相关阅读:
Top