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 "matt". 663 entries found.

You can also try this same search on Google.

[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

RE: Java Java Java

From the other Matt:

Russ got the #mobitopia IRC Links page up and running. So far today, my favorite links are:

I dig the java.com site - the layout/look is very cool IMO. Christina must be making a bundle from Sun, eh?

Posted in Java at Jun 10 2003, 01:21:10 PM MDT Add a Comment

RE: JavaOne 2003 Blogs

I might as well mirror this list from the great Cactus guru Vincent Massol.

Here are some persons that will be blogging from JavaOne 2003

Update: I added a link in the top-left for JavaOne Blogs. I will continue to add to this list as I find them.

Update 2: You can also checkout the webcasts.

Posted in Java at Jun 09 2003, 05:14:34 AM MDT 2 Comments

A little excitement in the Open Source Community

From Matt Croydon:

Thanks to Russ and the guys at #mobitopia, here's an Inquirer article on the JBoss fork/coup:

8:00 am -- Seven consultants for The JBoss Group publicly announced the immediate termination of their contracts and the foundation of their new company, Core Developers Network. Their charter "is to provide a commercial infrastructure to enable open source contributors to deliver their professional expertise to the marketplace, independent of their contributions to open source projects".

For some reason, reading the article made my heart beat a little faster. Good? Bad? Who cares! It's engrossing!

Posted in Java at Jun 04 2003, 12:36:00 PM MDT 3 Comments

News you can use - Quartz Plugin for Struts

While plowing through the 5000+ e-mails at work this morning, I tripped over the QuartzPlugin for Struts. This looks very cool - a way to configure scheduled tasks (i.e. a cron job) as part of your web application.

The QuartzPlugin for Struts allows you to automatically configure and start a Quartz scheduler upon initialization of your Struts application. It also places itself in your application context to make a scheduler available within your actions. That is, in addition to statically scheduled events like "every six hours," you can dynamically schedule events from Struts actions for "24 hours from now".

Now I just hope I get a chance to utilize this bad boy in the near future.

Posted in Java at May 28 2003, 05:56:13 AM MDT 1 Comment

RE: Abstract Classes vs. Interfaces

Yakuu provides a good comparison of abstract classes versus interfaces. This is an interested read for me, since I've only started using both of these in the last year - and only because I've seen/copied/extended other programmer's code. After using them for that long, I have to say that there's still doesn't seem to be much of a point. Of course, I'm rarely using mutliple inheritence and none of my projects have gone through a major refactoring. I'm willing to bet that Dave is happy he decided to use interfaces in Roller. The Castor -> Hibernate conversion probably would've sucked without them - or did they create more work?!

Posted in Java at May 12 2003, 07:44:36 AM MDT 2 Comments

[ANNOUNCE] Roller 0.9.7.2 Released!

Dave has released Roller 0.9.7.2. Get it while its hot! This site has been rockin' (IMO) since I moved to the new server. In fact, I haven't had to restart Tomcat once since I started it on Wednesday. That's a huge improvement considering it used to restart itself due to OutOfMemory errors 3+ times per day. Just goes to show that software is not always the one to blame - damn hardware - I'm just glad that I decided to try a new box before moving to a new provider.

I've added this to my Java channel for all you java.blogs readers. ;-)

Posted in Java at May 10 2003, 10:35:03 AM MDT 1 Comment

How to control access with Jabber?

So know that I've got a password-embedding scheme worked out for e-mail and moblogger, I have to figure out a way to do something similar with Jabber. Currently, in what I have working, there is no password verification, but it is needed. It's necessary to prevent just any-old-Joe from posting to your weblog. Of course, they'd have to know the username for your blog IM user (this listens for new posts), but it probably wouldn't be hard to figure out. My first thought is to have the password as the first part of the message, and then the message after that. For instance:

mypassword / Here is the rest of my post

I'd suggest doing this in the subject, but the problem with this is that you can send an IM without a subject, and I still want posts to succeed even if there's no subject (a.k.a. title). So whaddya think - would you be willing to type "password / rest of your IM" everytime to wanted to post to your weblog via IM?

BTW, the new server seems to be holding up quite nicely, eh?

Posted in Java at May 09 2003, 06:37:11 AM MDT 4 Comments

Running a process from a servlet

Note to self: This may help you in running moblogger from a servlet:

Process p = Runtime.getRuntime().exec("/bin/chmod 700 /path/to/myfile");

I found this nugget on the tomcat-user mailing list - and I'm assuming it can be used to run any command-line process.

Posted in Java at May 05 2003, 05:10:11 PM MDT 2 Comments

Hibernate's Query by Criteria (What I'd like to see)

After trying to work with Hibernate's new Query by Criteria feature in version 2.0, I've come up with a page detailing what I'd like to see. Basically, this page results from the API not working for my needs - and since it's still in its infancy, hopefully this document will help shape it future. I'll add a comments link on the document (to this post) for any feedback or comments.

Posted in Java at May 05 2003, 03:56:12 PM MDT 2 Comments