Spring Web Flow - spring-webflow

I am really having a problem about what to use as an alternative for web flow. I have read that not all functionalities should be handled by web flow. Only those which needs complex xstate management. For those easy stuffs like just login, editing or deleting records what will I use as an alternative for web flow?

Spring Web flow is specifically designed to implement complex page flows. It is an extension of Spring MVC and a tool to specify page navigation rules and manage navigation.
Spring Web flow provides fundamental answers to the following major problems in web application development:
How to specify page navigation rules?
How to manage navigation and conversational state?
How to ensure modularity and code reuse?
It is also integrated with JSF component model and used mostly for enterprise application development. There are not so many alternatives but but for Vaadin component model you can consider Lexaden Web Flow as possible alternative.

How did you build websites before Web Flow?
My understanding is that if something needs "back" functionality that has state information stored - like a "wizard", for example - Web Flow is the way to go. If you don't have state, I'd expect you'd build those pages as you always have.

Related

Spring Web Flow and Alternatives

I am building a a web app with Spring MVC and hibernate. I am struggling with scope. E.g., create parent and children on same interface requires resetting child bean after first child created. Spring MVC does not allow removal of bean from session scope. At the same time, shifting children across multiple request scopes is not practical. I need a conversation scope.
I am now looking at Spring Web Flow as a solution. However, it is poorly documented and seems to depend entirely on xml configuration. Both these features seem to suggest it is an older and perhaps not well supported project.
Can anyone advise on whether I should invest time learning Spring Web Flow, or perhaps suggest alternative solutions that tie into Spring MVC.
I've spent some time on this now.
I think the reason for xml as opposed to annotation is design. Once one has one's head around it, the flow config is simple and leads to very fast development.
Yes, it seems to be in maintenance mode, but the design is solid and reliable and development seems to be very efficient. Learning curve is a little steep, especially if integrating into an extant webapp, but I was up and running in about three days.
Webflow's own documentation is not great, but the tutorial linked here is excellent.
UPDATE
5 months on and I have built a complete assessment system (i.e test/exam system). My background is in IT and I have a Ph.d in psychology.
The system I built has been thoroughly tested and stress tested.
Advantages of webflow.
A person can start a test, give up and restart in the same session with no problems since flowState takes care of everything
There is full control of when the user can use the back button and how far back the user can go. Returning to state after an illegitimate backbutton usage is easy and user friendly.
Stress test performance is excellent
Configuration is easy. I spent almost no time dealing with design or bug issues related to Webflow.
FRom a higher level design perspective, there were no use cases that were required from a business perspective that could not be implemented.
Disadvantages
Since all objects are serialized before presentation on the webpage, you have to be very careful about how you cache objects if you take them out of the flowState beans.
Spring Web Flow appears to be maintained, but not in active development. I see a handful of commits, mostly updating dependency versions and fixing bugs.
You are correct that the configuration of the flow is XML-only, which I believe is the single biggest drawback of this aging Spring project. I have searched for a DSL or dynamic builders and I did not find anything.
Having said that, I'd give it a shot. Simple flows—even dynamic and inherited flows—are possible. In addition, the backing form and the POST-Redirect-GET Pattern implementations may be useful to you. That last technique prevents form resubmission when you use the browser back button.
I have been looking at webflow myself (for the past day, ~16 hours) since after I seen "primefaces".
Webflow offers varying types of states and transitions to those states. States can have a view associated with it (HTML page or JSP page -> primefaces comes in here). Each JSP pages are templates, like PHP just using java and xhtml. Using primefaces components the interaction between the client and server "seems" almost automated (a plus for quick development). Webflow also offers flow variables, which is a java data object. The flow variable can have the life over the flow and is used by views and templates. Webflow allows you to control transitions between all states.
However, I think this is where I stop my research. First, what is the advantage of webflow over a good client side web application using AngularJS with Spring MVC (#RequestMapping), if flow control is needed build it on the client. If you would like a variable that exists over the lifetime of the session, make a javascript variable, however if the variable needs to only exist on the server and you would like to use templates, then webflow seems like a ideal choice.
If you need a state-ful webapp then it might be a good idea to checkout Spring HATEOAS type concept (passing the state as a parameter to the client), and that parameter refers to limited time availability variables. Less coding and seems to conform to internet model better.

Intergration of OpenCms into spring webflow application

I have a application developed based on spring web flow framework. In my application i need to display some advertisements for that i opted for OpenCMS. But Integration of OpenCMS into my application im unable to do that. All available tutorials are like integration of web applications in OpenCMS. Here my requirement is reverse. Any inputs for this will be grateful.
Here some queries i want to know.
Can we Create webservice in the OpenCMS?
Can we call that webservice from my application jsp page?
Any inputs will be grateful.....
Thanks
Eventually a duplicate to Integration of Java application with OpenCms, however the question there is the other way around, how to integrate Spring into OpenCms.
Yes, you can implement web services within OpenCms, you can basically do anything within OpenCms that you can do with Java, JSP, Servlet technologies. You can deploy your own custom jars, taglibs, implement RESTful services, etc.
I think it would be good to explicitly know your difficulties or question in the very detail.
I mean, if you just want OpenCms to act as a web services back end, then it's not 'real' integration, then it's pretty much loosely coupled. Then, you just handle OpenCms as any other web services backend, not much difference. And this way would be pretty easy in terms of 'integration'.
Then, you would let OpenCms return json or xml, instead of html, by creating the templates and assigning them to your resources (i.e. structured content in OpenCms, using cms:contentload tag, but outputting json). That's "basically it". Therefore, not clear where exactly you're currently struggling within OpenCms, please let me know some more details and the current status of your OpenCms setup, experience, etc.

.NET ASP webpage inheritance

I am new to .NET and ideally want to make several layers of abstraction for making a fairly complex website. Being the first layer handling login, authentication, etc, with another layer handling the built in apps (how they look, predefined functions, database connections), and the lower level will be specific app implementation details.
This favors uniformity as all apps will inherit from one place allowing for easier maintenance and rapid development of all the smaller apps once the overhead abstraction layers handle their responsibilities.
The only problem is I am not 100% sure where to start with .NET ASP webpage inheritance. I tried Google and searching but I may not be looking for the right thing. I am hoping with someone with experience on the matter may direct me towards resources to make this kind of webpage inheritance/abstraction easier!
I am using Visual Studio 2010.
Edit:
I also want to add the purpose to my question: Another individual is creating the base of the website which will handle authentication, portal, UI look, etc
I want to make an app base that uses their website framework and adds onto it standards that every app must meet, function library, any addition UI overrides not applicable from portal, etc.
From there a third layer that will directly inherit from the above app base framework (abstraction) and further specify based on the guide lines made.
I appreciate the feedback so far!
In ASP.NET you have 4 common ways to reuse code/abstractions to serve you application-wide
The first way is just using a base page, which will inherit the standard asp.net Page and share the common logic for all of your pages, as explained here
The second way is using a master page: a master page defines a common design (html / css - wise) for all the pages that use it throughout the application. It can also be accessed programmatically by pages that use it, and therefore share a common logic
The third way is using an http module: An http module is basically a class, which is responsible for handling an HTTP request before its handled by the expected pages code on the server, and it allows you to add any common logic you want your application to use (such as authentication / authorization handling, getting relevant user information from the DB, etc)
Global.asax: contains application/session wide event handlers, which allow you to handle those events in once place (everything from application starting to a user session ending)
Using modules and base page is the preferred way, if you want to build few applications, sharing common behaviour. A master page can be used as well, of course, if you want them to share the same design as well.
That's quite a broad question. Welcome to ASP.NET!
I would suggest researching these topics:
Web page inheritance -> Master Pages,
Skinning -> App_Themes,
separation of responsibilities -> MVP design
pattern for the Web Forms platform, or MVC if you have a choice.
Login, roles -> Membership

Liferay for delivering RIA

I am currently looking into Flex and Liferay for delivering an RIA. We are replacing a rather large existing application built on an internal AJAX/Java library. For this, Flex seems to meet our needs for development but we've had a wrench thrown into the works. We need to integrate with another internal app that's been built on Liferay and JSF.
After looking into Liferay a bit I'm not convinced that it provides any benefits to our existing application since delivery via a portlet doesn't appear to have any inherent benefits other than achieving the integration with the other application. It also appears to have a number of downsides including smooth interaction between the swf and the rest of the page, hooking into Liferay's user management and their general lack of developer oriented documentation.
It seems to me Liferay is a good solution if you need an internal wiki/news/social application, but for delivery of a robust RIA it seems like we're trying to fit a square peg in a round hole.
My question is this: Is Liferay used for delivering full RIA applications or is it a platform that's better suited to delivering smaller apps? Am I missing something about Liferay that makes it a good fit for RIA?
Thanks in advance for any advice!
You can easily get a Flex app to show up in a portal (Liferay or other) but here are some issues you might run into:
1) Typical portal servers hold all of the state - for all of the portlets - on the server. Every interaction causes a page refresh which rerenders everything on the page based on the serverside state. For Flex applications you don’t usually want the state on the server. And you don’t want every interaction reloading the Flex app. Some portals are getting more Ajax’y which solves part of this but there will always be some interactions in HTML portlets or in the portal chrome that cause a page refresh. This means that Flex applications must done some work to persist state beyond a page refresh. A simple way to do this is using LSOs but this requires a lot of extra plumbing code.
2) Inter-Portlet-Communication (in JSR 168 portals) goes through the server based on a page refresh. This also doesn’t work well with Flex apps. JSR 286 is attempting to solve this to support Ajax portlet IPC. Until then making Flex apps work with standard IPC is difficult (but possible).
3) A big part of portals is entitlements, customizations, and preferences. These are all difficult to use and interact with from Flex. In JSR 168 portals there isn’t a standard way of doing this. In JSR 286 there is a standard which makes it easier for Flex to read and update user preferences.
4) With WSRP and other remote portlet technologies portal servers can consume remote portlets and proxy all requests back to the portlet provider. With Flex this is more difficult because portal servers don’t know how to proxy Flex requests (HTTPService, RemoteObject, DataService, etc). In many cases the only solution is to allow the end user’s machine to talk directly to the portal producer server. However many times this causes problems for IT because it means moving another server to the DMZ and potentially bypassing the security constraints imposed by the portal server, SSO server, Security Appliance, etc.
Have a look at www.qooxdoo.org. This is a framework for writing large applications entirely in javascript. It combines excellent GUI control with a java like programming paradigm for javascript and a clever build process for the final application.

Enterprise Security Application Block in Conjunction With MembershipProvider in ASP.NET

Looking to implement authentication/authorisation for ASP.NET app
Was looking into using Provider model MembershipProvider SQLServerMembershipProvider etc as makes good sense to me.
However I'm looking into the Enterprise Security Application block as well. My question is can/should the two be used in tandem?
Yes, these two components would play together nicely. In fact, one is built upon the other.
The more important question is, do you need both for your particular scenario? Look at what the MembershipProvider functionality gives you out of the box. What is it that the EntLib Security Block adds to this that is necessary for your application?

Resources