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 "framework". 558 entries found.

You can also try this same search on Google.

Persistence Options with existing SQL

At my new gig, it's not an option to use Hibernate. Their data model is too complex, and they've already written a bunch of code and it's corresponding SQL to get the information they need (think lots of inner joins, stored procedures and selects in where clauses). It was my task last week to port all the JDBC from one project to a more general framework to be used by all the websites we're building. The existing code is in the following form:

PreparedStatement pstmt = 
    conn.prepareStatement("select * from table where id=?");
pstmt.setInt(1, id);
ResultSet rs = pstmt.executeQuery();
MyBean bean = new MyBean();
if (rs.next) {
    bean.set(...);
    ...
    bean.set(...);
}

After doing all my persistence with Hibernate for the last year, it made me cringe to have to resort to this archaic (though tried and true) way of populating my objects. So I pinged the struts-user mailing list and asked what my options where for populating an object from a ResultSet. Basically, I was looking for a 1-2 line solution that didn't affect performance too much. After jossling back and forth for a while, I came up with 2 options:

I did some performance testing and the ResultSetUtils class had the same performance numbers as rs.next() { set, set, set }, so it was definitely a viable solution. The downside? You have to name your resultset columns the same as your object's properties - and it's case sensitive. iBATIS was also a slick solution - as soon as I added <settings useBeansMetaClasses="false"/> to my sql-map-config.xml file, the performance was comparable to the ResultSet options (I turn it on when deploying, off for unit tests).

My Point: We're using iBATIS for our Persistence framework, and I dig it. It allows us to keep the complex SQL (externalized in XML files) that has already been written and it took me about a 1/2 hour to setup. I'd recommend Hibernate if you're starting a DB from scratch, but iBATIS seems to be a great solution when the SQL is already in place.

Will I add an iBATIS option to any of projects? Naahhh, then I'd have to work with Hibernate to export the SQL for each call, and I'd have to update my XML file's SQL everytime I change something in the DDL (currenly Hibernate and XDoclet perform this magic).

Posted in Java at Sep 15 2003, 07:17:30 AM MDT 1 Comment

PHP vs. Java - which is better?

I have a former client that has a customer. This customer asked them - "so when are you migrating from Java to PHP?" So evidently this person has the impression that the next wave of web applications will be written in PHP. My former client has asked me to provide an answer for their customer. If I translate it, I think they mean to ask "what is different between Java and PHP and why should we use Java over PHP." Here are my opinions - please add yours as you see fit. I must admit I don't know a whole lot about PHP, except that it's widely popular among the Linux/Apache/MySQL crowd and that it's similar to ASP in it's lack of a MVC architecture (yes, I know about the PHP MVC project).

  • I think Java is more of an industry standard, whereas PHP seems to be popular among hackers and hobbyists.
  • Java provides better separation of layers - key for testability. PHP has all the code embedded in the page, so you have to run it through a browser to test if database connections work (for instance).
  • Java is more scalable.
  • More folks know Java and it's easier to qualify someone's Java skills. How do you test someone knows PHP? Is there a certification?
  • More for-profit organizations use it.

If you're a Java or a PHP-lover, I'd love to hear your opionions (facts are always better). I'm going to point my client to this post, so keep it clean.

Posted in Java at Aug 22 2003, 03:52:33 PM MDT 98 Comments

Building high-content web applications

I've recently been tasked with rebuilding a JSP-based site using a Struts architecture. One of the issues (that I see) in the current architecture is that there are a number of JSPs with the text for the pages hard-coded in them. After re-writing this app, we plan on deploying it to 25+ customers - and we certainly don't want to have 25 different JSPs (with text) for each customer. I've proposed a database, but that might be a little resource intensive - so I'm wondering how folks have done this in the past (I'm sure it's been done before)?

Options I see are:

  • A Database table with the following columns (page_id, title, content, section_id).
  • Text files that are imported using <c:import url=""/>

What options have you used (feel free to add more) - if you've used the database approach - how do you define the page table? Maybe we should use the Roller way and use Velocity and OSCache.

Posted in Java at Aug 19 2003, 06:30:28 PM MDT 18 Comments

Good JUG Meetings this week in Colorado

Tonight in Denver - Celebrating DJUG's award as a top 25 user group, Apache Xerces, and The J2EE 1.4 Web Foundation. Meeting starts at 5:30 and ends around 9:00. I'm going.

Tomorrow in Boulder - Web Frameworks by Kris Thompson. This presentation will cover a basic understanding of what in general a web framework is and then cover on overview of some of the more popular frameworks out there. I want to go, but squeezing 40 hours in a 3 1/2 day week will prevent me.

Posted in Java at Jul 09 2003, 07:01:16 AM MDT Add a Comment

[Hibernate] Open Session in View Pattern

I get this question a lot when folks check out my struts-resume application - so I figured I'd document it here - and then I can just send future developers a URL. The question is this:

Why do you tie your View to your Model Implementation by putting a Hibernate Session in your Service Interfaces?

I have a couple of reasons. The first reason is that I initially had ses.currentSession() and ses.closeSession() at the beginning and end of each DAO method. In fact, I found this old e-mail where you can see an example. This seemed to work for me and I was happy with it. However, I got an e-mail from Gavin (Hibernate's Lead Developer) that I was doing it all wrong. He said that I should use one session per request, rather than one on each method. Why? For performance reasons and to allow rolling back the entire session, rather than just a method. At least that's why I remember him saying.

So I refactored and implemented the Open Session in View pattern in conjunction with the Thread Local Session. You can checkout my ActionFilter and ServiceLocator for the View and ThreadLocal, respectively.

The problem now is that I pass my the Session object from my View -> Business Layer [example: UserManager] -> DAO Layer. So I'm tightly coupled with Hibernate, which I don't mind, because I really, really like Hibernate and have no plans to implement an alternate DAO (even though the architecture allows it). Even if I did choose to implement a new plain ol' JDBC DAO Layer, I can always get a java.sql.Connection from the Session using ses.connection(). Another option I've thought of is to just pass the ServiceLocator between the different layers, and call ses.currentSession() or ses.connection() when it's needed. But that seems to be the same thing I was doing before when I was opening/closing at the method level.

Comments and suggestions, as always, are welcomed and encouraged.

Posted in Java at Jun 11 2003, 02:12:31 PM MDT 8 Comments

[ANNOUNCE] Struts BSF (Scriptable Actions) 0.3

Boy, Don Brown is a busy man this week. He releases a new version of the Struts Cacoon plugin on Monday, and today he released a new version of Struts BSF.

This project allows Struts Actions to be written in the scripting language of one's choice rather than as Java classes. It uses the Beans Scripting Framework to allow scripts to be written in any language BSF supports like Perl, Python, Ruby, JavaScript, BeanShell, and I believe even VBScript.

Version 0.3 adds the ability to pass parameters from the Struts config file, a pluggable filter system to pre-define custom variables, more documentation, and more. [Learn More]

Looks cool, but I have no need (currently). If you're using the BSF and have experiences to share, please do so. I'm interested, it just hasn't made it past my crap filter yet.

Posted in Java at Jun 04 2003, 02:46:56 PM MDT 1 Comment

Draggable IFRAMEs

Matt Kruse's JavaScript Toolbox is awesome. So good, in fact, that I've actually made a donation (small, but nevertheless, a donation). Today, I noticed a new script: Draggable IFRAMEs. I dig it. Don't know that I'll ever use it, but I've always liked drag n' drop examples for the web. While they are cool, I've found that sometimes a true popup window is much easier.

Posted in The Web at Jun 04 2003, 10:50:30 AM MDT 9 Comments

Hotels.com powered by Struts!

This is kind of a cool announcement - giving more credibility to Struts. Personally, I think all the leading web application frameworks are great - and can probably be learned in a week or two (or a few days/hours!) - so it's not about which one you're using, it's about if you're using one or not. If you are - you're on the right path. If not, you're probably wasting a lot of time developing your own.

I am proud to announce the successful launch of a major vacation packaging site whose presentation tier has been built entirely with Struts:

http://packaging.hotels.com/packaging/index.do

We have made extensive use of the Struts MVC framework, custom tags, and I18N components, with some custom modifications. It has proven itself to be a stable and robust platform, able to amply handle the needs of both our users and management.

I would like to applaud everyone who has worked on the Struts project; it has been shown yet again to be an excellent framework for a commerical web application.

James Childers hotels.com Packaging Team

Posted in Java at May 30 2003, 10:59:40 AM MDT 1 Comment

[ANNOUNCE] New Hibernate Versions (1.2.5 and 2.0 RC2)

Hibernate has released new versions of it's awesome persistence framework. I'm biased because I use it and it makes my life/job a lot easier (not to mention this site a lot faster). Not to mention that it's a finalist of JavaWorld Editor's choice awards.

Posted in Java at May 10 2003, 09:40:57 AM MDT Add a Comment

WebWork and XWork Mavenized

Maven Propaganda I currently monitor the WebWork mailing list because I'm interested in the framework, and it's good to know what's going on over there. This morning I was impressed to see that one of the developers (seemingly overnight) Mavenized both WebWork and XWork. Very cool IMO. I especially like the Project Reports. If I do promote Moblogger to SourceForge, I think I'll mavenize it first thing. It's a small project at this point, so it'd probably be fairly easy to do. And we all know that some of the most successful open source projects are built on top of good documentation. So the real question is - wiki vs. maven?

Posted in Java at May 07 2003, 10:24:17 AM MDT 4 Comments