Matt RaibleMatt Raible is a writer with a passion for software. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.
You searched this site for "beans". 112 entries found.

You can also try this same search on Google.

[TSE] Designing Stateful Web Application Control Flow with Erwin Vervaet

Spring Web Flow (SWF) does not fit into an application or a feature where free-flow navigation is required. It works best where you need to lock down and control navigation. SWF is not designed to be a web framework, but rather to solve the specific problem of navigation and state management between many pages.

Erwin is a Senior consultant at Ervacon and has extensive experience using Java SE and Java EE. He is the inventor and co-lead of the Spring Web Flow project.[Read More]

Posted in Java at Dec 08 2006, 03:47:49 PM MST 5 Comments

[TSE] Using Dynamic Languages with Spring with Rod Johnson and Guillaume LaForge

Spring 2.0 has dynamic language support. To make it work, you do need a Java interface as a contract between callers and dynamic beans. There's no special requirements on the interface. It's a "POJI" and doesn't have to extend or implement anything. For example:

public interface Messenger {
    String getMessage();
}

There's 3 ways of configuring Groovy beans:

  1. GroovyScriptFactory <bean> element defining source location and properties
  2. <lang:groovy> element from a <lang> namespace
  3. POBD (Plain old <bean> definition) - this is unique for Groovy since it can be compiled into Java bytecode

[Read More]

Posted in Java at Dec 08 2006, 01:27:43 PM MST 2 Comments

[TSE] Rapid Web Application Development with Rob Harrop

There's a couple of other sessions I should probably go to, namely Juergen's talk on Transactions and Mark Fisher's Message Driven POJOs Rock! However, transactions is generally a pretty boring topic and I don't see myself developing any MDPs in the next two weeks. If you don't use your knowledge in two weeks, you generally lose it, so I'll wait to learn more about MDPs until someone pays me to. I know a fair bit already, so I don't know that there's a whole lot more to learn.

I'm attending Rob Harrop's Rapid Web Application Development Essentials talk. With any luck, I'll learn some new tips that we can use in AppFuse.[Read More]

Posted in Java at Dec 08 2006, 11:42:37 AM MST 7 Comments

How do you get open source frameworks past the red tape?

From an e-mail I received earlier this month, with a subject of "Acceptance red tape":

After requesting permission to use the Spring Framework for the business logic and data access layers of an application, how do you fight something like this? Spring is not an approved Framework for the ********** environment. We understand the benefits of the framework. However, we have not certified it in our environment. Additionally, we have concerns that this framework will not gain long standing traction among the J2EE community. We would like to reduce the number of frameworks used in our environment, and do not want to be left with "legacy" frameworks that have little acceptance or support as is the case with the pico container. This is a response from one of our clients after asking about the use of a framework in our development after another vendor had used the PicoContainer without their permission. We have Spring experience and we love it. My responses have been to ask what they have certified that we could use and to ask their business staff to override their tech staff. I'm caught needing to redesign an aging J2EE application with an awfully over-architected original design confined to EJB 2.1, JSP 2.0, Servlet 2.4, and JDK 1.4.X in a very short amount of time. The additional responses were that they have only certified Struts and although both the business staff and the tech staff admit they know the benefits of Spring, neither of them are allowing us to use it.

My response:

Wow - I don't know what to say, especially when they say "Additionally, we have concerns that this framework will not gain long standing traction among the J2EE community." They're probably using Struts and they thinks it's wonderful, eh? ;-)

I could compose a long response with lots of details, but the fact that they prefer EJB over Spring is baffling. Spring is so much easier to program with, it's not even funny. Granted, EJB does have its place, but it's often used as a hammer for a problem that doesn't exist.

Have you experienced similar "Acceptance red tape" in your company? If so, how did you work around or work through it?

Posted in Java at Nov 16 2006, 08:04:24 AM MST 31 Comments

Using the Java Persistence API with Mike Keith and Patrick Linskey

I'm sitting in a presentation on JPA from Mike Keith from Oracle and Patrick Linskey from BEA. They asked the room how many folks are using (or have used) JPA. About 6 hands went up in a room of 50-60 folks. JPA is definitely bleeding-edge, and based on my experience, it's not quite ready for prime-time yet. I think this is obvious as most products that implement JPA haven't had a final release yet.

Background: Part of JSR-220 (EJB 3.0). It began as a simplification of entity beans and evolved into POJO persistence technology. JPA's primary features are:

  • POJO-based persistence model (simple Java classes-not components)
  • Support for enriched domain modeling (inheritance, polymorphism, etc.)
  • Expanded Query Language
  • Standardized object/relational mapping (using annotations and/or XML)
  • Usable in Java EE and Java SE Environments
  • Support for pluggable persistence providers

At this point, I tuned out to post my presentation from this morning. Most of the talk seemed to be pretty standard, as in they showed annotations, the EntityManager interface, and some JPA QL. Interestingly enough, they used the same entities that Thomas did in our Kickstart application. I wonder if there's a JPA tutorial out there that everyone is building their presentations from. ;-)

One interesting thing I heard from Colin is that Spring/Interface21 is looking into creating ready-to-go starter applications. For example, something that allows you to start with Spring + Hibernate right away, or to create something like Salesforce.com with minimal effort. Sounds similar to AppFuse, but who knows.

Posted in Java at Sep 26 2006, 12:23:24 PM MDT 1 Comment

Spring Forward 2006 - The Keynote

After a 1 and a 1/2 hour cab ride, I arrived at Spring Foward 2006 just in time for the opening keynote. It looks like I'll be doing a 2nd talk this afternoon as Clark Richey was unable to make the show. I was given a choice of talks, and I chose "Comparing Web Frameworks" because that's a fun talk to do.

Thomas Risberg introduced the show (and the new Philadelphia Spring User group site), and now Colin Sampaleanu is talking about Spring. Spring 2.0 is fully backwards-compatible. There's a huge user base that demands full backwards compatibility so their old code still works. Spring 2.0 will run on your existing infrastructure: Java 1.3, 1.4 or 5. It'll run on all major application servers, as well as a simple servlet container.

The first major new features in Spring 2.0 are the simpler (extensible) XML configuration, as well as new AOP mechanisms.

XML Configuration in Spring 2.0

  • Ability to define new XML tags to produce one or more Spring bean definitions
  • Tags out of the box for common configuration tasks
  • Problem-specific configuration (easier to write and to maintain)
  • XML schema validation (better out of the box tool support, code completion for free)
  • Exploits the full power of XML (namespaces, tooling, etc.)
  • Backwards compatible (full support for <beans> DTD, complete interoperability b/w classic and extended configuration)

JNDI Lookup example (Spring 1.2.x):

<bean id="dataSource" class="...JndiObjectFactoryBean">
    <property name="jndiName" value="jdbc/StockData"/>
    <property name="resourceRef" value="true"/>
</bean>

In Spring 2.0:

<jee:jndi-lookup id="dataSource" jndiName="jdbc/StockData" 
    resourceRef="true"/>

AOP in Spring 2.0

  • Simplified XML configuration using <aop:*> tags
  • Closer AspectJ integration (pointcut expression language, AspectJ-style aspects in Spring AOP, @AspectJ-style aspects in Spring AOP that are fully interoperable with ajc compiled aspects)
  • Build on strengths, eliminate weaknesses
  • Preserve ease of adoption (still zero impact on development process/deployment, easier to adopt)
  • Benefit from the power of AspectJ
  • Spring and AspectJ are still separate projects, but work close together since both projects' leads work for Interface21

AOP is about pointcuts:

  • Pointcuts give us the tool to think about program structure in a different way to OOP
  • Without a true pointcut model, you only have trivial interception
  • By integrating AspectJ's pointcut expressions in Spring AOP, it's a much more powerful AOP framework

Hot on the heals of Spring 2.0, Spring Web Flow 1.0 will be released. It's a full Spring subproject and part of Spring's web stack. Using SWF, you can capture a logical flow of your web application as a self-contained module, at a higher level. Another interesting project is Spring LDAP. It's a Spring subproject that simplifies LDAP operations - based on the pattern of Spring's JdbcTemplate. It encapsulates nasty boilerplate plumbing code traditionally required for LDAP.

Finally, Spring 2.0+ will support OSGI. So what is OSGI? It's an industry driven framework specification, with multiple implementations. It has a dynamic omponent model, based around the idea of bundles. It's a full component model with classloading (for isolation and versioning), lifecycle control definition, etc. It's the foundation of Eclipse's plugin architecture.

Why do you need Spring-OSGi? Spring-OSGi is an integration library for Spring in OSGi environments. For those that need it, allows a more powerful component programming model. Without Spring having to re-invent the wheel, ApplicationContexts become bundles that are able to import and export services with full isolation and integration into OSGi lifecycles. The project is moving along rapidly, with large amounts of interest and involvement from vendors such as BEA, Oracle, IBM members of the OSGi foundation and the general public.

Finally, don't forget about The Spring Experience 2006. It's 3 days, 55 sessions across 5 tracks, including: Core Spring 2.0, Core Enterprise 2.0, Core Web 2.0, Domain-Driven Design and Just Plain Cool.

Posted in Java at Sep 26 2006, 08:14:01 AM MDT 2 Comments

Validation Framework Consolidation

Looks like Jason Carreira has stepped up to the plate to try and consolidate the validation frameworks we have in Java. I'm sure it was a joint effort among many, but Jason's name is the only one I see on the JSR. I applaud this effort - it's definitely needed.

I've used Commons Validator, the XWork Validation Framework as well as Hibernate's Validator. While Commons and XWork work, the ability to annotate a class and validate it anywhere/anyhow is pretty cool. I reviewed an article a couple months ago that hooked Hibernate Validator into Spring MVC and Prototype for client-side validation. There's a lot of good stuff in this space - let's hope this JSR creates something even better. More than anything, let's hope it doesn't brush off client-side validation like JSF did. ;-)

In an ideal world, the RIFE, Spring MVC, Stripes, Struts, Tapestry and Wicket developers will all participate and allow JSR-303's result to be used as their framework's validation engine. I think it's a given that this will be usable with JSF.

Posted in Java at Jul 11 2006, 02:05:37 PM MDT 18 Comments

Seam 1.0

I've posted my thoughts on Seam 1.0 to my Virtuas blog. What are your thoughts?

It's great to see the release of Seam 1.0. Seam is similar to many full-stack frameworks like Rails, Rife and AppFuse in that it gives you all the pieces you'll need to build a kick-ass web application.

I've blogged my thoughts on Seam before, so there's no need to do that again. I like the idea, especially the lack of interfaces and the 3-files-for-each page idea. However, I don't know that this concept will fly with Java developers. I agree there's a need to simplify, but many of us are mesmerized by the de-coupling that Spring gives us. So now we're programming to interfaces, and every-so-often swapping implementations. I don't know that we can switch to this simpler model. And then there's the "EJB" thing. I think there will be a fair amount of developers that don't use EJB3 simply because it has the "EJB" name. The best thing the EJB Expert Group could have done for EJB3 would be to give it a new name.

The other thing I worry about with Seam is that it wasn't developed from an existing application. AFAIK, it didn't get extracted from a real-world application that had all the problems that Seam solves. I know that Gavin is a smart guy, and he's probably seen these problems in the real world, but there's nothing like developing a real-world application with a technology - and then extracting the framework from that.

In reality, I'm probably jealous. Seam has some really cool features, JBoss has done a great job of marketing it, and it seems to be a really cool way to develop applications. If I'm going to make AppFuse a direct competitor to Seam, it's gonna be quite the uphill battle.

Posted in Java at Jun 13 2006, 04:45:48 PM MDT 5 Comments

RE: Thoughts on the future direction of AppFuse

Sanjiv has some interesting thoughts on the future direction of AppFuse. To summarize: take on Seam head-to-head, but use Spring instead. Get rid of all the other frameworks except for JSF, Spring and Hibernate. Furthermore, focus on making Web 2.0 applications easy to create and use.

I like Sanjiv's ideas, but I'm not so hot on ditching all the other web frameworks in favor of JSF. I'm still not convinced it's the best solution for Java web development. The idea behind JSF is great, but the implementation has warts. Maybe that'll be fixed with JSF 1.2, but it will likely be quite a few months before MyFaces supports it. Yeah, I know there's the RI, but it is an RI and you remember the 1.1 version don't you? ;-)

I'd hate to give up WebWork support because I've used it on a couple of projects and really like it. Ditching Spring MVC would likely be a mistake as well since it's the most popular web framework among AppFuse users today. While I love what Tapestry brings to the table, it is harder (for the newbie) than JSF. Also, it seems to be the least-used web framework in AppFuse, which means I'm doing a lot of maintenance for no reason. AppFuse 2.0 will definitely make things simpler (JDK 5, Maven 2, standard directory layout, better IDE integration), but it will still be difficult to support 5 web frameworks and 2 persistence frameworks.

What do you think about Sanjiv's proposal? It sounds good to me. However, I'd rather see different lead developers for each framework and continue to support them all - except for Struts of course.

Posted in Java at May 22 2006, 08:16:53 PM MDT 28 Comments

[TSSJS] Friday Morning: RIFE and Seam

This is my 2nd day in Vegas and so far this town is treating me fairly well. I haven't lost all of my money, but the $25/hand blackjack tables haven't been kind. Yesterday, I woke up with a glass full of Berocca next to my bed - which means I passed out before drinking it. I needed it too, Matt Filios won a poker tourney and a bunch of us enjoyed "bottle table" (with Kettle One vodka) to celebrate. Spendy and good, but painful the next day.

Last night, I heard it was Crazy Bob's bachelor party, so I went to bed early to avoid the debauchery. Julie and a good friend of mine are flying in tonight, so there will be plenty of that this evening. So after a good night's sleep, I'm up early and attending the conference. The first hour has a lot of good sessions: Introduction to Seam (Gavin), Dive into RIFE (Geert), OSWorkflow (Hani) and Transforming Enterprise Java into a Commodity (Geir).

I'm sitting in Geert Bevin's session titled "Dive into RIFE" and it's a pretty small audience - maybe 20 people. Geert is the CTO of Uwyn, a small custom application development company. He's the founder of RIFE and creator of many RIFE projects: RIFE/Crud, RIFE/Jumpstart, RIFE/Continuations, Bamboo (forum), Bla-bla List (RIA todo list), Drone (Information bot) and Elephant (blog).

What is RIFE? It's a full-stack component framework to quickly and consistently develop and maintain Java web applications.

  • Integrated layers allow you to quickly get results with a minimal amount of code
  • Best practices are enforced in a pleasant way, providing many additional features and a consistent approach throughout all applications
  • Components can easily be resused in many contexts
  • Creating maintainable applications is our first goal
  • A lot of attention goes to code-level developer comfort
  • Frustration reduction by instant changes and reloads
  • Creative solutions for difficult problems
  • Embraces established standards (XHTML, HTTP, SQL, ...)
  • Geared to developing web applications and doesn't abstract away too much
  • Everything besides the web engine is designed to be independently usable
  • Attention to the whole life-cycle of your application

Geer is now talking about all the different pieces of RIFE - how it has a JDBC abstraction like Spring JDBC, web services support (even publishing of RSS Feeds) and a content management framework. Now we're going to look at RIFE/Jumpstart.

What is RIFE/Jumpstart? It's a source archive that you unzip and run. It makes it easy to start with new RIFE applications and contains everything you need (including Jetty). It has immediate support for more common development environments (X-develop, Netbeans, Eclipse, IDEA and Ant). Geert just showed us a video of getting started with Jumpstart and how you can easily use X-develop to build and deploy the app to Jetty. The Jumpstart application currently uses JUnit, but since the RIFE teams is starting to use TestNG more and more, it's likely they'll change in the near future. RIFE Jumpstart looks similar to AppFuse, except they have the save+reload problem solved - using JVM HotSwapping.

Now I've moved to the Introduction to Seam session. Gavin King is the presenter and the room is packed. It's a big room, so that's saying a lot. Gavin is talking about JSF, how backing beans work and what's in the faces-config.xml. How does Seam compare to J2EE? Much simpler code. There's fewer artifacts (no DTOs). Less noise (EJB boilerplate, Struts boilerplate). More transparent (no direct calls to HttpSession or HttpRequest). It's also much more powerful for complex problems.

JSF is amazingly flexible and extensive. EJB interceptors support a kind of "AOP lite" and EJB3 is a powerful ORM engine. Everything (except for the JSP pages) is unit testable can be tested with JUnit or TestNG. For testing the view layer, Gavin recommends using Selenium.

A backing bean is often "pure glue" and is just noise. Furthermore, it accounts for more LOC than any other component. It doesn't really decouple layers, in fact the couple is more coupled than it otherwise would be. Gavin calls this "wedding cake architecture." These applications look good in the window, but don't taste good when you eat them. I get his point, but have to disagree on the taste of wedding cake. It's always been good at the wedding's I've attended. ;-)

By default, web applications in general do not work in a multi-window application. To make it work, it generally requires a major architecture change. A couple of other areas for improvement in traditional web applications: application leaks memory (not cleaning up session objects) and "flow" is weakly defined. Navigation rules are totally ad hoc and difficult to visualize. How can this code be aware of the long-running business process?

JBoss Seam - what does it do? It unifies the EJB3 and JSF component models. It simplifies Java EE 5, filling a gap. In addition, it integrates jBPM and makes it more developer-friendly. Deprecate so-called stateless architecture. Decouple the technology from the execution environment. Run EJB3 apps in Tomcat or in TestNG or use Seam with JavaBeans and Hibernate. Gavin is using Tomcat for the first time and thinks it's hot-deploy architecture is totally broken. Of course, he usually uses JBoss and never has a problem with hot-deploy. It's interesting to hear this from Gavin, especially since I've heard from others that Hibernate breaks the reloading - and it's not the server's fault.

I'm going to head to another session now, but I did look ahead at some of Gavin's slides. Interestingly enough, the jPBM pageflow definition's XML looks quite similar to Spring Web Flow. Speaking of flows, I heard an interesting comments from someone yesterday after they attended Geert's continuations talk. Apparently, after seeing his talk, they think that RIFE's continuations offer a much more elegant solution to pageflow than these "XML programming" mechanisms.

I tried to go to Hani's OSWorkflow talk, but he was doing Q&A when I walked in. Apparently, he finished 25 minutes early. Then I walked into Geir's talk only to find Dan Deiphouse finishing up an XFire talk. Oh well, there's nothing wrong with having a few minutes to mingle between talks.

Posted in Java at Mar 24 2006, 11:56:30 AM MST 7 Comments