I have a web-application (struts2) that runs on a remote server and the users communicate with a database (mysql).
My first thought was to JAR the web-application and use its classes in the swing application. (Obviously some correction to the database connectivity but nothing big).
Then I heard something about SOA and WSDL and wonder if this is a better idea than my initial reaction with the JAR.
Before I embark on this journey called SOA I wonder if anyone can advise if this is a better path, and if so, where should I start and what is requested for WSDL?
Where is the business logic? If you implemented Struts with the Model View Controller design pattern, then business logic and data access logic should not be in the web application.
if you coded business logic and data access logic in the Struts Action classes, this was wrong.
I don't know other way to build struts applications if not with MVC; my business logic is separated from the view.
I use iBatis DAO to access the DB, so I have interfaces and their implementation to do the job. The action-classes ask for a DAO and get the result. (again separated from the action and the view).
Ok, how do I proceed from here? I take it that I only need to use the implementation of my DAOs and use them as web-services (right?!)
Building the Model in the Controller is bad design and violates the Model View Controller design pattern.
The Struts Action classes that you wrote are part of the Controller. Struts-based code is either Controller or View
"Today, could you execute the insertExpense method from a command-line?:
Request updateRequest = (Request) session().getAttribute(Properties.CASE_REQUEST_IN_SESSION);
What about the dependency upon the HttpSession above? It should not be in your business method.
These search and insertExpense methods should not be coded in a Struts Action class,
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|