I'm kind of seek help in design (or may re-usable pattern) based on ranchers experience.
I have one Inventory web-service which has couple of operations exposed. I'm using Apache CXF (JAX-WS2.0) and design is simple as follow.
WebServiceImpl -> Spring Service (2.5.6) -> Hibernate DAO (3.x) -> DB (MySQL)
These web-services works fine & satisfies need for the business for end clients. However, I'm now in need of preparing a web-ui which pulls/updates the data using the web-app. (Not all CRUDS - But at least Read, update and search).
Design I'm preparing is-
WebApp (JSP) - Action - (Re-use) Spring Service (2.5.6) + Any new Services -> remaining layes as it is.
My intention is to re-use Spring Service layer and DAO layer I've written (May be with new interfaces for web-application). Is this a valid (good) design to tie back-end implementation of web-service & web-application togather ?
SCJP1.4 (92%), SCWCD (85%), SCBCD (81%), SCEA-I (In Progress)
Is this a valid (good) design to tie back-end implementation of web-service & web-application togather?
No this is not a good design. It is better to keep web services and web applications separate. Both can certainly work together and have their own codebase.
Joined: Oct 06, 2007
Thank you for your response. Can you help me in understanding why keeping those two seperate shall be better ? I've seen Appfuse framework example where they have got Web-Application & Web-Service (User service) tied togather in one war. I also posted similar question on their forum but has received no response yet.
Joined: Apr 16, 2008
Thank you. Examples on Internet websites do not always show efficient designs, workable solutions, or accurate information. Loose coupling in terms of system components will help in many areas, e.g. maintainability, system agility to handle revisions, etc.
Your signature line states that you have multiple certifications in software design. So, I'm sure that you have learned the reasons why keeping these two components separate is better. You just need to think a bit harder
Joined: Oct 06, 2007
Thank you for your response again. Yeah, I'm thinking & validating my design. However, it's always good to understand feedback/review from people who have attempted such things. I'm now trying modular web-app approach with three modules
1) spring/dao - in a single jar
2) web-app (war format)
3) web-service (war format)
In above, last two refers 1st jar in pom.xml. I'll post if anything is un-obvious I come arcoess.