Matt RaibleMatt Raible is a Web Developer and Java Champion. 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.

In San Francisco

I'm in San Francisco this week doing some Spring Training. I flew in this afternoon and I'm staying only a couple blocks away from Moscone center. It's kinda weird being here when JavaOne isn't going on. It's even stranger to be staying on the block next to Kate O'Brien's and the Thirsty Bear. About an hour ago, I got to watch the fog settle in over the buildings - which is always a cool site. I'm looking forward to a fun week of teaching and showing developers how their lives can be vastly simplified by using Spring.

Posted in General at Jul 17 2005, 11:00:55 PM MDT 6 Comments

Pretty radio buttons and checkboxes

Philip Howard has a nice tutorial on creating pretty radio buttons and checkboxes using CSS and Javascript. Nice work Philip. Hat tip to CSS Beauty.

Posted in The Web at Jul 17 2005, 05:04:01 PM MDT 1 Comment

It's been a while now...

Today is my birthday and I'm happy to say that I'll be goofing off all day. 18 holes this morning and a former-company reunion party tonight. I'll spare you from my birth story this year. If you really want to read it, you can check out last year's entry. :-D

Posted in General at Jul 16 2005, 08:17:28 AM MDT 9 Comments

[DJUG] Building an Open Source ESB and Ruby on Rails

Managing Chaos
Building an Open Source Enterprise Service Bus from Scratch

Bruce Tate got rained out in Texas, so Bruce Snyder and Jeff Genender are talking about building an ESB with open source software. Bruce and Jeff created this product in the last project they were on. I was lucky enough to work with them on it the first half of this year - but only after the ESB was created. The final product was very stable and the client loved it.

Bruce is a Geronimo committer and one of the founders of the Castor project. Jeff is also a Geronimo guy and is currently working on a JBoss Live book for SourceBeat. The problem that the ESB was trying to solve was fixing a horrendous data flow. A lot of the data flow was occurring between people's PCs, shared drives, FTP servers, HTTP Servers, web servers - and rarely were things automated. Bruce recalls one of his first days when he heard the trading guys yelling at each other to "close the spreadsheet".

The solution to the problem was building an Enterprise Service Bus (ESB) that performed the following:

  • Centralized Management of Activities
  • Powerful Scheduler
  • Guaranteed Event and Activity Execution
  • Durable Transactions
  • Pluggable ESB Components for Activities
  • Staging Database for Single Common Data Location
  • Logging and Notification of Activities
  • Proactive Response to Failed Activities
  • J2EE Architecture - Provides for True 24/7 Uptime

The pluggable components were called transformers and were standalone JARs that lived on their own, but could be managed by the ESB. Notifications were key so the traders would be notified when something went wrong.

Architecture

Scheduler (Quartz) » Workflow (jBPM) » Persisted Guaranteed Messaging (JMS). JMS talked to Activities (a.k.a. transformers).

The Quartz Java Scheduler is an open source project from OpenSymphony. It's a persisted scheduling engine, so it'll live through app server restarts. It also has millisecond granularity.

For workflow, the Java Business Process Manager (jBPM) was used. It doesn't use BPEL, and was used to track multiple activities and make decisions based on an activity's completion or failure status. Other functionality included tracking the activity state (running, cancelled, completed) and sending/managing notifications. Workflow was very important because the previous system had no way of detecting where things failed in a process. With the new system, downstream dependencies were handled, the escalation path was based on success or failure - and automatic retry occurred on failures if the failure reason was a known and configured expectation.

For messaging, JMS was used - implemented with EJB and MDB. This provided guaranteed and persisted messages. Events were automatically recovered if the server failed.

Activities/Transformers were pluggable components (wrapped with EJBs for transactionality). The nice thing about using EJBs was it was easy to create JARs for each transformer, drop them into JBoss and they'd immediately become available.

The system was all managed with a management console, that was a webapp implemented in Struts, Spring and Hibernate. Most of the Spring and Hibernate classes and configuration was generated with Middlegen and XDoclet. The management console allowed you to kick off activities, monitor their progress, as well as manage users with Active Directory and single sign-on with NTLM and jCIFS.

Solution Facts

Since December 2004, over 200,000 jobs have been run through this system. Of those, 500K activities have been run, with < 10,000 failed activities (2% failure rate). Nearly all failures were due to external issues, such as unavailability of remote systems and databases, or source files not available.

Tools and APIs Used

When Jeff showed up, it was a Microsoft shop using ASP, Visual Studio and some PowerBuilder. They brought Jeff in to help them use and adopt open source. The first thing they did was install and begin to use CVS (previously source control was done on shared drives). They also used Maven to build everything and produce a project site - which the managers and C-types loved. One thing they mentioned is they often got questions from higher-ups like "How much does it cost?" They did have problems with Maven, but it was mainly due to the poor documentation. They found a lot of Maven solutions by cracking open plugins and looking at their Jelly files.

Development Lessons Learned

Configuring EJBs and MDBs as singletons helped solve some problems (a JBoss setting allows you to configure this). As for running Spring in a heavily-managed environment, they found that setting singleton="false" solved a lot of problems. The next problem they had was mixing Hibernate and JTA Transactions. No details, just that they had an interesting time and it took them a few days to get it working. The last problem they encountered was using Hibernate and/or Spring JDBC to manage hundreds of thousands of records. Since these O/R tools create objects for each record, OOM errors occurred with large resultsets.

Business Lessons Learned

All notification messages came from the ESB, leading many to believe the problem was the ESB - rather than the data sources it was talking to. By using open source, they saved the company $500K in licenses fees. The interesting part was the company had a 3rd-generation agreement with IBM, and owned $12 million worth of licenses for WebSphere and WSAD. The reason this group used open source was because there weren't enough licenses.

Bruce and Jeff's presentation was good, but they looked like a couple of goofballs standing up there in their t-shirts and shorts (standard Virtuas gear). I guess that's what happens when you get a 2-hour notice. The worst part about the presentation was the fact that the A/C doesn't work and it's about 85° in here. I told Geary he'd better keep in short or I'm outta here. ;-)

Ruby on Rails
David Geary

David got into Rails by reading an article called "Rolling with Rails". In the article, the author claimed that you can develop webapps in Rails at least 10 times faster than in Java. David responded to the article on his blog with an entry called the Ruby on Rails Koolaid. He experienced quite a butt-whooping from various folks, including Rails' founder - and realized afterwards that the claims might be valid. After working with Rails, David believes that Rails is probably 5-10 times faster.

Ruby

Potent mix of SmallTalk, Perl and Python. Everything is an object. No static type checking. Duck Typing (talks like a duck, walks like a duck, it probably is a duck). Testing usually solves the lack of static types. Blocks - like anonymous inner classes, but retain state. Mixins - a cheap way of doing multiple inheritance. Dynamic classes - can modify at runtime (add methods, renaming methods, etc.). Rails takes great advantage of the dynamic attributes as part of its framework.

David is now showing a ContactsController that has 5 methods for CRUDing a Contact object. 4 of the 5 methods are one-liners. It kinda reminds me of my Hibernate DAOs after integrating Spring. ;-)

Rails

Ruby-based MVC framework. Convention over configuration. Scaffolding - builds pieces of your application for you. ActiveRecord does O/R Mapping. Has a built-in testing framework. Near-zero configuration (no XML). Zero-second deploy time (development environment).

David's first demo is being done by audience member Kirk. David asked for a volunteer from the audience with MySQL experience, and the ability to type in a few commands. David said his 6-year old daughter was able to do this demo last night successfully - so Kirk's gonna look pretty bad if he can't pull it off. ;-)

Using scaffolding, Rails generates 1 controller, a test for it, a helper class, a css file and 5 rhtml templates. Kirk pulled off the demo, even though he had a bit of trouble with the Mac environment. This is a lot like AppFuse's AppGen in a sense - except AppGen has to parse a bunch of XML files and reconfigure them.

David keeps hammering that the most productive feature of Rails is that there is zero deploy time. Save. Refresh. It looks very similar to developing a static HTML site.

Rails has ActiveRecord, ActionPack (MVC), ActionMailer, ActionWebService, Ajax Support, Transactions and Security. Currently at version 0.13.1 - the last version before 1.0.

David is delivering an excellent presentation, but it's too damn hot without A/C - I'm outta here.

Posted in Java at Jul 13 2005, 11:03:46 PM MDT 6 Comments

DJUG Tomorrow - Bruce Tate and David Geary

Tomorrow night looks to be a great night at Denver's JUG. Bruce Tate is presenting Beyond Java and David Geary is doing a session on Ruby on Rails. Both are great speakers, which I think is more important than the technical content itself. The only thing I'm worried about is Geary can be a real windbag. The last session of his I attended was on JSF in October of 2003. It was the first time I'd "met" him (never talked directly, just learned about his credentials) and the meeting lasted for about 3 hours. So David, let's keep it short and sweet so we can do some networking afterwards at Rock Bottom. ;-)

Update: Looks like Bruce Tate won't make it. Bruce and Jeff are going to present on developing an open source ESB in his place.

Posted in Java at Jul 12 2005, 11:23:30 PM MDT 2 Comments

Scaling with Rails

Whenever I talk to developers in the Java community about Rails, the first question out of their mouth is usually "But can it scale?" Today, David has written a nice post titled It's boring to scale with Ruby on Rails.

The one thing that I see time and time again is that Java developers don't seem to realize that some of the highest traffic sites on the net are using LAMP stacks similar to what Rails advocates. IMHO, I don't think "Rails can't scale" is a valid argument. In fact, I don't know if there's any argument or way to put down Rails anymore.

As a developer, my guess is the rates for programming in Ruby developer are less than for programming in Java (unless you're a Ruby Superstar of course), so that's one reason not to program in it. However, since Rails is one of those new bright and shiny things, chances are you might be able to get high rates for it. As far as Enterprise Adoption of Rails, unfortunately I think that's still pretty far on the horizon. I think the hardest part is convincing management that they'll be able to find developers to support it. Mind you, I didn't say good developers, just developers. Period. This is information I've gathered from talking to my Java developer friends.

Try convincing a Fortune 500 company to program in Rails vs. Struts and they'll probably choose Struts because there are thousands of Struts Developers. Is this a good decision on their part? I don't think so. I think it's more important to hire smart people that can learn a technology, rather than hiring those that know a technology. Of course, if someone knows a technology really well, there's probably no harm in hiring them.

I think Rails can become a real contender in the Enterprise if managers can be convinced that it'll be easy to maintain Rails application. Remember that most of software cost is maintenance. Because of this, the whole "it's super productive to develop with" doesn't matter so much - does it? Are Rails applications easy to maintain? My guess is yes, but how do you convince CTOs and CIOs? Another thing I think Rails needs for Enterprise Adoption is good tool support. Drag and Drop type of stuff. Why? Because management loves that stuff (because then they can develop apps) and it's a great sales tool. ASP.NET has been successful because of Visual Studio, not because of its ease-of-use and simple syntax.

Will I learn Rails and use it to develop applications? I certainly hope to, but it's hard enough convincing companies to use something other than Struts - so I don't know if I'll have much luck in selling Rails. The one cool thing about my new job at Virtuas is its an open source company, not just a Java open source company. This opens the doors for me to learn about Rails (and others) and compare them to Java Web Frameworks.

Update: Aaron Rustad has written an interesting article for DeveloperWorks that compares Rails to Struts+Hibernate: Ruby on Rails and J2EE: Is there room for both?

Posted in Java at Jul 12 2005, 08:45:26 AM MDT 28 Comments

How to be a better Trainer/Teacher

Kathy Sierra has a great post titled Ten Tips for New Trainers/Teachers. This hits home with me because because I've been doing a lot of training lately - and plan on doing a lot more in the future. I think she has a lot of great points, and I certainly plan on using her ideas as best I can. Luckily, I already use some of them - but I could certainly use some more, like group exercises and ditching slides in favor of more interactive sessions.

Here is a quick summary of this post:

Eleven Things to Know

  • Know the difference between "listening" and "learning".
  • Know how the brain makes decisions about what to pay attention to, and what to remember.
  • Know how to apply what you learned in #2. In other words, know how to get your learners to feel.
  • Know the wide variety of learning styles, and how to incorporate as many as possible into your learning experience.
  • Know the fundamentals of current learning theory!
  • Know why--and how--good advertising works.
  • Know why--and how--good stories work.
  • Know a little something about "the Socratic method". Know why it's far more important that you ask the good questions rather than supply all the answers.
  • Know why people often learn more from seeing the wrong thing than they do from seeing the right thing. Know why the brain spends far less time processing things that meet expectations, than it does on things that don't.
  • Know why it's just as important to study and keep up your teaching skills as it is to keep up your other professional skills. Yes there ARE professional organizations for trainers, with conferences, journals, and online discussions.
  • Know why using overhead slides to deliver a classroom learning experience can--sometimes (often)--be the worst thing you can do.
  • Know how -- and why -- good games can keep people involved and engaged for hours. Learn how to develop activities that lead to a Flow State.

Ten Tips for New Trainers

  • Keep lecture to the absolute minimum.
  • It is almost always far more important that your learners nail fewer subjects than be "exposed" to a wider range of subjects.
  • For classroom trainers, the greatest challenge you have is managing multiple skill and knowledge levels in the same classroom! Be prepared to deal with it.
  • Work hard to get everyone to complete the lab exercises, but NEVER give out the solutions in advance!
  • Do group exercises whenever possible, no matter what you've heard.
  • The best execises include an element of surprise and failure.
  • Leave your ego at the door. This is not about you.
  • Have a Quick Start and a Big Finish.
  • Try never to talk more than 10-15 minutes without doing something interactive. And saying, "Any questions?" does not count as interaction!
  • Don't assume that just because you said it, they got it. And don't assume that just because you said it five minutes ago, they remember it now.
  • If you're not passionate, don't expect any energy from your learners.

And most importantly: It's not about what YOU do... it's about how your learners feel about what THEY can do as a result of the learning experience you created and helped to deliver.

Good advice Kathy - and much appreciated. I'm doing a full week of training in San Francisco next week, followed by a tutorial on AppFuse (at OSCON) in early August - both should give me a nice stage to test these ideas.

As far as your classroom experiences - which ones have you enjoyed the most? What did the instructor do different? How have you been inspired by a training course?

Posted in Java at Jul 12 2005, 08:12:38 AM MDT 2 Comments

eXtremeTable - another table tag for sorting and paging

From the AppFuse mailing list and the Spring Forums, I learned about eXtremeTable. This JSP Tag looks similar to the Display Tag, except that it includes support for checkboxes and filtering columns out-of-the-box. If you've used this tag, please let me know how it's working for you.

eXtremeTable Demo

Posted in Java at Jul 11 2005, 07:33:47 AM MDT 26 Comments

What's the best way to synch iPhoto Libraries?

Having two 17" PowerBooks around the house has led to a problem. We've accidentally imported our photos onto both machines, and now we don't have a true master that contains all our pictures. To rectify the problem, I tried using rsync to update my ~/Pictures/iPhoto Library directory with the one from the 2nd machine. All the pictures were migrated successfully, but not the photo albums, nor the thumbnails in iPhoto. I even tried importing the new pictures, but it says the file is not a valid image (even though I can open it in Preview just fine). Any ideas for a better synchronization strategy?

Posted in Mac OS X at Jul 11 2005, 06:02:50 AM MDT 6 Comments

New Bike - Giant FCR3

I had the pleasure of buying a new bike this weekend (my last one was stolen in June). Rather than replacing it with a mountain bike, I got a commuter. I've heard they're great for riding around town and can make the ride-to-work thing a lot faster. I'll probably buy a mountain bike too, but I'm going to hold off until next year for that - the Bus will be taking over as my top time-consuming hobby in the near future.

New Commuter - Giant FCR3

Update: More about the Giant FCR3.

Update 2: I set a new record on the ride to work this morning: 23 minutes! I took the long way to get home and it took 45 minutes. My goal is to reduce both times by 25% by the end of summer.

Posted in General at Jul 10 2005, 11:20:46 PM MDT 10 Comments