I have to investigate the possibility of using JBoss and Seam to build user interfaces to data held in a database controlled by an off-the-shelf package. I've been reading through some of the Seam documentation, and various other sources, but I can't seem to clear the confusion I'm currently suffering from.
My problem is that everything I've read so far talks about using JPA/Hibernate to access and persist data directly in a database schema, but the package I'm working with doesn't allow (or actively discourages) direct updates to any schema that it controls. It does however present what looks like a comprehensive data-access API delivered as an EJB. With the basic assumption that it's entirely possible, my question is how would I go about building a Seam app that uses this EJB for all data access? Is it a simple thing or am I heading for a whole heap of pain? Can anyone point me in the direction of reading material that will help me?
Apologies in advance for the newbie nature of this question, but I've been dropped in at the deep end on this and I'm struggling to pick up so much new knowledge. Any help will be very gratefully received.
Many thanks
Steve
Seam is mainly an inversion of control (IoC) container that provides a lot of boilerplate functionality for web development. It has no real hard requirements for you to use JPA/Hibernate. It's just that the most usual scenario for Java web development is a database backend that's mapped by an ORM, of which JPA/Hibernate is probably the de-facto standard.
If your data access layer (DAL) does not exist or is just wrapper around an existing API (web services, REST, etc.), Seam will also handle that scenario very easily and provide you with all its remaining functionality (session management, JSF integration, security, navigation flow management and lots more).
In essence, a simple component (or set of) that exposes the API you mention and handles its state should be enough. Then again, I do not know your requirements, so I can't say that for sure.
A more complex example is the Seam Social module in Seam 3. It uses Twitter, Facebook or other social web APIs to connect to those services and inject them into Seam's contexts', so that your application can leverage their functionality. I don't know if your scenario is so complex that it would require you to build an entire CDI module from scratch (as Seam Social does) but take a look at their documentation. It might give you some ideas on what further investigate.
Related
I' writing a web application with Wicket 1.4.X, Hibernate 3.6, and Spring 2.5.6.
I have some objects
For Example:
Person
name
SSN
positon
etc....
now some fields are not editable. say SSN, however other fields like position, are only editable for managers. If a supervisor makes the change, it gets forwarded on to a manager for approval. I have a homegrown system currently in place for part of this. However, it seems to me that an actual workflow system would allow me to collect all of the rules into one nice convenient location rather than having them scattered around my code.
I'm looking for a system that is:
Simple
Integrates well with the technologies I'm already using
Doesn't require a separate server
(the app is internal I don't need "on-the-fly" rules changes)
I keep coming across references to jBPM having no "real" experience with workflows it looks like the easiest/most efficient route to install it is by installing Drools. The Drools and jBPM integration Guide even talks about Spring integration.
However, the documentation felt sparse and I didn't completely understand what I was looking at. Before I start down the (what I assume to be long) road of Drools/jBPM I wanted to get a community consensus from people smarter then me on the subject of workflows.
UPDATE:
I talked with my boss about this issue. We currently have another "in-house" application. (currently maintained by external contractors) that's using Stellent, now known as
Oracle Universal Content Management with Oracle BPM. While I should probably learn these technologies since I will more then likely wind up maintaining that other app, it just feels counter productive to integrate a whole UCM/BPM solution into the guts of my application if I've already setup the Front-End and the DB back end.
(Caveat: My only experience with a CMS was Plone, about 2 years ago and I am not a Python programmer.)
I guess you could just use wicket auth roles. http://wicket.apache.org/learn/projects/authroles.html
This is a very beginner question. I have tried to search for advice but am overwhelmed by the amount of information and would like some help with ideas on approaches to server design or what to search for!
What I would like to set up is a backend server that provides search capabilities and business logic and validation across some fairly basic data. It wont get too large.
I would then like to be able to plug in a website as a front end or a mobile app or a facebook app or even a desktop app..
My question is what is the best way for front ends to hook into the backend? I would like to have various user accounts with permission levels so authorisation would be important.
I generally only code as a hobby so whilst technically I have built a spring based website before the exact semantics of the client server relationship weren't clear to me. Now I want to separate the backend so that is is agnostic of how the data is displayed or entered completely and can run on a separate machine.
Thanks,
Rob
There is a ton on options. I had good expirience with apache CXF rest services (logic encapsulated in java beans, spring configuration) and pico web remoting ( more exotic,
but also rest service and plain java objects providing business logic)
if you ar already using spring, I would recommend to stick with CXF - it integtrates seamlesly ( and is spring configured itself )
I'm currently working on implementing the public API of our web application. The application is written in Java.
This is a financial application deployed on Tomcat. My users can manage their sales, customers, purchases, inventory, etc. It's a pretty huge application. The font-end is written in Java/GWT. The backend is written in Java s well. We use the GWT-RPC mechanism between.
What we want is to provide a way to access the financial data (read + write) via a public API. This way, developers will be able to better integrate their application (like a payroll application).
We don't use any framework. No Spring, grails, whatever. Also, no Hibernate, JPA, etc. It's a pretty old app, with lot of proprietary code for the ORM, XML-> javabean. authentication, etc. Cannot change all of that as the application is already in production and it just works that way.
The API infrastructure will be on a different sub-domain and on a different server.
The API should use Oauth to authenticate the users.
I looked into Grails, Play!Framework and Restlet to achieve my goals
Does anyone have some thought on them? Am I going in the wrong way with those frameworks? Is there another framework to look at?
Thank you all
I'd recommend following the example of Amazon and such and expose that API as web services, without regard for UI. Your have a further choice about SOAP versus REST. I think you'll find that REST will be simpler for your clients, because they only need to know about HTTP.
This doesn't mandate the use of any frameworks if you choose not to. The back end will work regardless of whether or not you use Spring, Hibernate, Grails, etc.
You'd have to rework the application you have to call the services if you wanted true reuse, but it might be worth it in the long run. Both your UI and clients would be using a common back end API that way.
I have some thoughts yes. Financial applications tend not to use OAuth. To be clear: nobody with vulnerable data uses OAuth. That includes privacy, medical and financial data.
What kinds of deployment environments do you expect to use this API. That might narrow it down, the standard answer if you have absolutely no idea who your client is, is still supposedly SOAP (since so many people know and accept the buzzword).
If you're going to expose read/write to a Java-based financial services application over the public internet, I would look at SOAP-based web services with JAX-WS as there is a pretty mature security spec in WSS and the API is relatively easy to use and may not require much in the way of changes to your existing app.
REST is perceived as easier in general but for this type of application you might find your target audience is more familiar with SOAP anyway. All depends who your target audience is and exactly what you're trying to achieve, but worth considering.
I'm creating an online music store application (in Java) for signed and unsigned artist for my client.
I'm currently using Struts 1.3.10 (I was recommended Spring but Spring setup is sort of similar to Struts) for my Web application.
My Database is currently a MySQL 5 (or higher) and I'm using a DAO pattern to talk to it. There are limitations to using Struts and DAO's (e.g. Multiple File upload in Struts is not implemented the same way as multiple String parameters, and for DAO's, there lacks a Publish-Subscribe feature).
Is what I'm doing the best way forward or should I go straight Hibernate (or similar) and move out of Struts? What are the performance implications or technical issues that you've experienced with the same setup I have?
The client doesn't care how I do it as long as it is done.
You could also use both Struts and Hibernate. The key point of Hibernate is that you store whole objects, without having to worry about it. The performance of Hibernate is pretty good. It is easy to use for just storing objects and hard to understand when you want advanced things.
If you've got complete free-rein as to what you an write it in, and assuming that you want to use a Java platform, then do take a look at JBoss Seam and/or Grails too. Both can use Hibernate as the persistence engine and have RAD tools to allow quick construction of skeleton CRUD webapps. Seam is an especially rich framework offering all sorts of built-in features like arbitrary event-listeners, Ajax updates, file-uploads, etc. but takes a bit of getting your head around whereas Grails is easier to get started with.
Struts 1.3 is kind of old now (though still a good MVC framework) and the newer frameworks have better support for handling conversations (i.e. workflow across multiple requests) which Struts 1.x & Hibernate can make a little awkward at times, as well as AJAX features that you might want to implement at some point. Spring MVC which you mention is good too, but is a lighter-weight framework that the ones I mentioned before. Grails is now supported out of SpringSource too, so it should "have legs" so to speak.
I am embarking on a new RIA project with Java on the backend. I'm the only developer, and the app is a line-of-business application. My current stack looks like this:
MySQL || Spring(JdbcTemplate for data access) || BlazeDS (remoting) || Flex(Cairngorm)
My question is: what changes can I make to improve productivity? Manually coding SQL, server-side entity objects, client-side value objects and all the Cairngorm stuff is obviously a drag, but I'm not sure what higher-level frameworks to introduce.
What Flex/Java stack has served you well?
Manually coding SQL
Hibernate is an option to cut this out.
One thing that may be of interest is Grails with the available Flex Plugin. It's built on Spring, Hibernate and BlazeDS, so it's all there for you. It was unbelieveably easy to get it remoting stored objects and responding to AMF calls. I was using this and then moved over to a RESTful E4X implementation as I found it a lot easier to debug and tweak as I could inspect the server output in a browser and have tighter control over exactly what I returned to my Flex app (lazy loading problems in collections using BlazeDS were a headache at times).
Here is a quick tutorial showing how easy the whole Grails + Flex Plugin stack is: BlazeDS in Grails
I would seriously reconsider using Cairngorm. In my opinion it's a pretty bloated framework that introduces a lot of abstraction you'll never use. Check out:
http://code.google.com/p/swizframework
http://www.spicefactory.org
Both introduce the concept of dependency-injection into your Flex app.
Also +1 for Hibernate. I would use the standard JPA annotations on a Java class and extend that with Hibernate Annotations as you find you need additional functionality.
Check out springsource.org's new Spring BlazeDS Integration Project
Spring BlazeDS Integration is a new
addition to the Spring portfolio, and
a component of the complete Spring Web
stack. This project's purpose is to
make it easier to build Spring-powered
Rich Internet Applications using Adobe
Flex as the front-end client. It aims
to achieve this purpose by providing
first-class support for using the open
source Adobe BlazeDS project and its
powerful remoting and messaging
facilities in combination with the
familiar Spring programming model.
As alternative to hand-coding sql, aside from hibernate, you might wanna consider JPA/Toplink. And since you are already from a Spring camp, check out Spring ActionScript (formerly known as Prana), it's an IOC framework for Flex. It solves many inherent problems in Cairngorm. Also a good IDE that supports Flex/Actionscript like IntelliJ IDEA 8.
Whats missing between Flex and BlazeDS is, it doesnt have any sort of landing page where you have a listing of all the available services by just typing a url on the browser (similar to webservice endpoint).
You can try GraniteDS. It's an alternative to BlazeDS, with an actionScript generator, Spring integration (an Spring security), and if you use an JPA implementation, help you with the Lazy Initialization (in a transparent way).