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.

Bad Knee

The first time I went skiing this season (back in mid-December), I had a lot of pain in my left knee. It hurt tremendously when I'd get on and off the lift. It seemed to be caused by bending it. I tried skiing a bump run in the afternoon, but that hurt even worse and it took me about 30 minutes to work my way down Drunken Frenchman at Mary Jane. The next week, I went to the doctor and he said it looks like I have a cartilage tear. He said I could relax and reduce my activities for a month and I'd have a 50/50 chance of having to have surgery (notice that he didn't say should). Apparently, the surgery is pretty minor and I could be back in action in a week or so.

The rest of December, I stuck to blues and my knee quit bothering me so much. Even the powder day at Steamboat wasn't too bad. Earlier this week, I was able to ski 7 runs in 2 hours at Mary Jane - 5 of those being bump runs. So am I back in action w/o surgery? No, not really. I am able to ski blacks w/o too much pain, but afterwards it does tend to be pretty sore. Same thing after riding my bike to work or playing basketball.

What would you do? This is turning out to be one of the best ski seasons ever and I feel like I'm at 80% of where I could be w/o the torn cartilage. I feel like I can make it a couple more months, have surgery in March and be ready for mountain bike season in April. Am I putting my knee in grave danger or is it just a matter of handling the pain at this point?

Posted in General at Jan 11 2008, 11:27:07 AM MST 7 Comments

REST and Seam Talks at Denver's JUG

After a long hiatus, I decided to attend the Denver JUG meeting this evening. Tonight there's a couple of interesting talks:

I'll do my best to live-blog these sessions, so hopefully you can read along and learn everything I do.

Give It a REST by Brian Sletten
This talk isn't an implementation talk, it's more of a motivational talk. Brian is trying to answer the question "Why do we care?". We care because we have a lot of WS-Dissatisfaction. "Conventional" Web Services are often:

  • too difficult for non-trivial tasks (real complexity)
  • too complex for trivial tasks (artificial complexity)

RPC-based Web Services are mythically interoperable and time/process coupled in painful ways. SOAP has largely become popular because of marketing dollars behind in. REST is more like the "hippy" way that has grass-roots support with no corporate sponsor.

What makes SOAP difficult? It's remote procedure calls and its tunneled using existing application protocols (HTTP). Furthermore, there are no nouns (mappings to business terms), only handlers. There are no semantics, only handlers. When you tie yourself to a contract/WSDL, you can have anything back that you want - so as long as its simple XML. This isn't entirely true because a lot of things can be shoved into XML (Word documents that are Base64 encoded).

The main problem with SOAP is it solves a problem that most people don't have. It solves an edge case, rather than the main problem.

Many people say "SOAP is secure and REST isn't".

Why do people believe this? It's because of the long list of SOAP-related security acronyms: XML Encryption, XML Signature, XKMS, SAML, XACML, WS-Security, WS-Trust, XrML. Even if you're using these in your system, there's no proof that your implementation is secure. REST is what we all use on the web with online shopping, etc. We don't seem to have a problem with the security we use everyday on the web, do we?

SAO is an architectural style promoting loose coupling among software participants. Sompanies have rigid definitions of what constitutes a SOA. Many believe that SOAP is an essential piece, but it's not. SOAP 1.2 and Doc Lit are improvements, but are they necessary? Interestingly, 85% of Amazon's users chose REST over SOAP when given the choice.

What is REST? The acronym stands for REpresentational State Transfer. It's an architectural style based on certain constraints designed to elicit properties of scalability and extensibility. It's an idealized notion of how the early web should work and helped drive the way it eventually did work. It's more than just URLs!

Resource-Oriented Computing focuses on information spaces, not code or objects. It focuses on logical connections and reduces complexity by separating actions from nouns. In the history of the web, we started with URLs that pointed to documents. Eventually, these documents became dynamic and were generated on-the-fly.

URLs are locations on the web that are horrible names because they change so much. URIs are good names that have no way of being resolved. Fundamentally, REST is a separation of the parts of the system: Nouns, Verbs and Representation. A Resource (in a REST architecture) can be a file, a service or a concept. It can also have different representations. Resources are named with Resource Identifiers. It's simply the means of naming a resource. It's a standard syntax that allows various schemes. Often known as URIs (or IRIs). It's orthogonal to satisfying the reference and it's one of the missing pieces of "normal" web services.

Examples of Representation include 1) a particular dereferencing of a Resource Identifier to a Resource at a particular time, 2) a byte-stream tagged with metadata or 3) it could change based on request or processing/display capabilities of the client (Firefox vs. WAP).

REST's verbs are design decisions to minimize the the complexity of implementing a system. GET retrieves a resource and always returns the exact same result. It doesn't change anything in the backend system. Because of this, it allows for easier layering of your system - particularly when you introduce caching for GETs. POST is used to create (or update) a Resource. It does not require a "known URI" and it supports the append operation. PUT creates (or updates) a Resource, but requires a "known URI" and also supports an overwrite operation. Lastly, there is DELETE, which removes a Resource. This is not supported in modern browsers. Just because browsers don't support them doesn't mean you can't implement them in your applications.

REST's concepts were developed by Roy Fielding in his thesis. He was trying to create a system that had the following architectural properties: performance, scalability, generality, simplicity and modifiability. REST allows us to create true client-server applications. To satisfy scalability requirements, REST is stateless. All parameters travel with the request and no session information is maintained on the server. This improves scalability through load-balancing and allows visibility of intermediary processors.

One of the first things that becomes a bottleneck in enterprise systems is the database. This works fine if you like paying Oracle. By using REST and HTTP concepts, it's easy to take advantage of a cache. This allows replication of an external data set where it's too large to copy locally. REST allows you to create Layered Systems that allow you to have managed dependencies between layers. Having a RESTful architecture allows you to swap out the backend without changing the front-end and vise-versa.

Now Brian is going to do some demos using NetKernel. He recommends using HTML documents to describe services. The beauty of developing a RESTful system is there's nothing preventing you from appending ?wsdl to your URLs to return SOAP.

Invoking functionality using web-friendly techniques is a very nice way to build web applications.

What is controversial in REST? When you are not dereferencing you should not look at the contents of the URI string to gain other information.. However, if you structure your URLs in your application in a hierarchical manner, people will be able to use URIs in this way.

What isn't controversial? No one believes you should rely on sessions or other state at the application level. They also believe using nouns, not verbs is an excellent idea.


Seam by Norman Richards
Seam isn't just a web framework, it's an integration technology for building applications for the web. It's a technology that takes your persistence and web technologies and unifies them so you have a simpler view of your system.

First of all, what is Seam?

  • It's a unified component and event model - you access all your components the same way
  • It has a declarative state with a rich context model
  • It provides deep integration with minimal glue code
  • It minimizes configuration, prefers annotations to XML
  • It allows a freedom of architectures and technologies
  • It also allows testing of components in context

With Seam, you have a number of technology choices to make. The first is which business component model you want to use (EJB 3 vs. POJO). You might choose EJB 3 if you want more clustering capabilities. For persistence, you can use Hibernate or any JPA implementation. Norman recommends using JPA if possible. You also have a choice of languages: Java or Groovy (and possibly Scala in the future). Seam gives you a choice of web frameworks. All the examples today will use JSF, but there's also support for GWT and 2.1 will have support for Wicket. Also, there's some non-committers developing support for Flex. Norman believes component-based web frameworks are the best way to develop web applications. While I hear this from a lot of folks component-based framework authors, it seems ironic that the "best" way to develop webapps is not the most popular way (PHP, Struts, Rails).

I think it's ironic that there's a REST (no state) and a Seam (it's all about state) talk in the same night. I'm tempted to ask why a stateful architecture is better than a REST one, but I'm not really that interested in the answer. I think your architecture should be determined by the needs of your application, rather than choosing the architecture and then implementing an application with it.

In addition to choices, Seam gives you a number of tools: CRUD generation, Eclipse and NetBeans support and full IDE support in JBoss Tools / JBoss Developer Studio.

Now Norman is doing a demo - starting by creating a new Seam Web Project in Eclipse. He mentions that he's skipped a number of steps: downloading and installing Seam, downloading and installing JBoss and configuring your Seam installation and database in Eclipse. He has two projects in Eclipse - apparently the New Project wizard creates two - one for the application and one for testing. It's strange that the tests don't go in the actual project. The directory structure has src/action and src/model for your Seam components. After doing some simple CRUD, Norman starts JBoss and looks at the master/detail screens it generates.

To make a Java class a Seam component, you usually only have to add a @Name annotation to the class. While trying to show us how the Authenticator/login works, Norman tried to open components.xml. Unfortunately, this crashed Eclipse and 30 seconds later - following a bevy of "file does not exist" errors, we're back in action. To inject dependencies in a Seam environment, you use the @In annotation. In the example class, here's what the code looks like:

try {
  currentUser = (Person) entityManager.createQuery("select p from Person p where" + 
       " p.email = #{identity.username} and p.password=#{identity.password}").getSingleResult();
} catch (NoSuchEntityException e) {
  currentUser = null;
}

This example appears to encourage title coupling with the data layer, rather than loose coupling (i.e. a DAO layer). I'm sure Seam doesn't prevent you from developing a more loosely coupled application.

Bug Alert: The <h:messages> tag looks like it always has an <li> - even when there's only one message. Struts 2 has the same issue with its <s:errors> tag. It's disappointing that so many Java framework developers don't have more attention to HTML details.

Probably the coolest part of Norman's demo is how Eclipse auto-synchronizes with JBoss so he never has to start/stop anything when he changes Facelets pages or Java classes. Of course, hot deploy should be possible with any web application if you're using Eclipse Web Tools effectively.

I do believe all-in-one starter frameworks like Seam, Rails, Grails and AppFuse are excellent. However, I also believe they're solving a problem that only 10% of companies have. Most companies don't have the ability to start applications from scratch - unless they're a startup. Most companies have an existing infrastructure in place for the backend and they simply need a better web framework to slap a pretty face on it. I don't know the best solution for this, but it seems like a logical choice to RESTify the backend (possibly with a web framework) and then use a modern web framework for the front-end. IMHO, the best web frameworks for a RESTified backend are Flex, GWT and Appcelerator. If nothing else, these appear to be the most hyped for 2008.

Many of the enhancements that Seam has added to the Java web programming model are being pushed back into the Web Beans JSR. With Seam, injection is bi-directional (input and output), is continuous during application invocation and dis-injected after action is done. The whole purpose of this is to let Seam handle the state of your application. By not worrying about storing/maintaining state, you as a developer can concentrate on business logic more and get your applications done faster.

At this point, Norman started talking about Seam's events and how you can use them. Unfortunately, my battery ran out and I drifted off to do some other stuff. I'm sure Seam's Event Model is pretty cool, I just missed it.

Posted in Java at Jan 09 2008, 08:59:45 PM MST 5 Comments

All my favorite Feed Readers are now free!

I've been using NetNewsWire ever since I started subscribing to feeds back in October 2003. A year or two later, I bought FeedDemon for my Windows box and synced them up using their online sync feature. When I got a BlackBerry Pearl almost a year ago, I bought NewsGator Go!. While the online sync hasn't worked very well between all these applications, I've generally been very happy with them and haven't been inclined to switch.

Now there's no good reason to ever switch:

NetNewsWire 3.1 is free!

By free I mean both that we've released it from its cage and that it costs no money. Zero dollars.

Upgrades are free. It's free for new users. It's freeware.

You can download it right away. Here are the change notes.

NetNewsWire is not alone -- we've also made FeedDemon, NewsGator Inbox, and NewsGator Go! free.

Thanks NewsGator!

Posted in Roller at Jan 09 2008, 04:09:14 PM MST 4 Comments

Tech Meetup in Silicon Valley next week?

Dave's going to be in California next week:

I'm going to be traveling to California next week (Jan 13-18) to sync up with my co-workers at Sun HQ in Santa Clara. I'll be in town Sunday through Friday and though my days will be pretty busy, I'll probably have some free time in the evenings for a meet-up or two.

Coincidentally, I'll be out there as well (Tuesday - Friday @ LinkedIn). Sounds like an excellent excuse to meetup and have some beers. Wanna join us?

Posted in Roller at Jan 09 2008, 03:16:40 PM MST 3 Comments

The Wrong Day

Riding Home in the Snow Apparently, today was the wrong day to ride to work.

This morning when I rode to work, it was a sunny winter day. When I walked to lunch with some office mates, it was pretty nice out. Around 3 o'clock, I looked out my 18th floor office window and gulped - it was snowing like the dickens. Then I remembered that riding in the snow (or rain) always makes me feel more alive. When I unlocked my bike for the snowy ride home, I had a smile on my face. I wasn't smiling when I wiped out in Wash Park trying to take a corner too fast. Luckily, I didn't get hurt and made it home just fine.

Posted in General at Jan 07 2008, 05:31:27 PM MST 2 Comments

A Weekend in Nebraska

This weekend, a college friend (Miller) and I hopped in his car and headed to Nebraska to visit an old friend. We went to college with the guy and he is appropriately named "Cletus". Friday night, we stayed at Cletus's girlfriend's house in Torrington, Wyoming. The highlight of that evening was going to the drive-through liquor store and ordering some Guinness. The guy working there looked at us a bit funny, but they did have it. We learned that up until last year, you could get a mixed drink at the drive-up liquor store and drink it on the way home.

After having a couple beers, we asked Cletus what the plan was for Saturday. He said he had to work in the morning and we could meet somewhere to watch the football games in the afternoon. I told him we wanted him to put us to work. He said he'd call us later in the morning and we could come out and meet him. I said I'd rather do it the right way and get up and start at the crack of dawn like he does.

Sunrise in Nebraska The next morning (or rather 5 hours later), he woke us up, we had some black coffee and cough drops for breakfast and we headed out to Gering, Nebraska. The drive to Cletus's Feedlot was one of the highlights of our trip. When we left Torrington, it was dark and the Sun was just beginning to rise. The drive was 30 minutes and we got to enjoy one of the most beautiful sunrises I've ever seen.

The smell of cow shit began in Torrington and didn't end when we arrived at Cletus's workplace. Instead, it proceeded to get worse, and stuck with us for most of the weekend (as it eventually ended up on our clothes). That morning, we started off by shoveling the snow and ice from the feeders. Then we fed some cows by driving through the fields and "flaking" off bales of hay. Next, we drove around the feedlot with shotguns and tried to scare off the black birds that were eating the cows' food. Our shot-to-kill ratio was abysmal. Then we helped Cletus shuffle the cattle around while he "scraped" their pens with a front-end loader. Walking around in 6" deep cow shit was quite the experience. To end the day, we helped "doctor" a calf that was bloated. This consisted of sticking a pipe down its throat, then shoving a tube through the pipe into its stomach. Miller got to experience the smell from the end of the hose and he's surely traumatized for life.

Workin' on the Feedlot Miller's ready for the Blackbirds

One interesting technology-related thing I noticed was how much they used wireless and laptops on the feedlot. The main office (or rather trailer) has a wireless network setup and they have laptops in various buildings that connect to it. These laptops were Dells running Windows (I didn't see what version) that used applications to track the cows (by ear tag). Within seconds, they were always able to find out the medical history of a cow and enter new data after they treated it. It certainly wasn't modern-looking as there was lots of dust and dirt on the laptops. However, it was interesting to see how they effectively used technology to track everything.

After working on the feedlot, everything was pretty much standard for a visit to Nebraska. We enjoyed some beers at the local bar during the Seattle game, took a nap and then headed to "The Pink Palace" for the best steaks in town (or so the locals thought). Following that, we played some pool at the "OT" and retired way too late.

Sunday we drove back and laughed at all the memories we created while in Nebraska. It was truly a fun weekend, one I won't soon forget.

Posted in General at Jan 07 2008, 01:34:58 PM MST 3 Comments

Acegi Security 1.0.6 and Spring Security 2.0-M1

From the Acegi mailing list:

Release 1.0.6 is now available from Sourceforge:

http://sourceforge.net/project/showfiles.php?group_id=104215

This is a minor bugfix and maintenance release - the changelog can be viewed here:

http://jira.springframework.org/secure/ReleaseNote.jspa?version=10671&styleName=Text&projectId=10040

The jar files should also be available from the central maven repository.

Spring Security 2.0-M1
----------------------
This is the first milestone release of Spring Security 2.0. You can download it from:

http://static.springframework.org/downloads/nightly/milestone-download.php?project=SEC

The changelog can be found here:

http://jira.springframework.org/secure/ReleaseNote.jspa?projectId=10040&styleName=Html&version=10451

For maven users, the jars are available from the Spring milestone repository. For details on how to add this to your project, read Ben Hale's article.

I tried this release with AppFuse and all tests pass.

Posted in Java at Jan 04 2008, 12:31:37 PM MST 3 Comments

Goodbye 2007, Hello 2008

Last year, I did an exhaustive year in review. This year, I don't have as much desire to spend hours writing a blog entry. Sorry - that's what archives are for. ;-)

Jarvis post Somersault The last couple of weeks, I've managed to spend 6 days skiing, enjoyed lots of time with family + friends and had a great Holiday Season. I'm also still having a blast being a dad. Abbie got a "She's a natural skier" on her report card from Ski School last weekend and I had an awesome 9" day at Steamboat with the soon-to-be-famous Jarvis Barton. Life couldn't be much better right now - especially considering my New Year's Resolution:

Ski more. Read more. Be Happy.

With any luck, Abbie and Jack will be skiing blues with me by the end of the year. Next weekend we hope to take the Ski Train to Winter Park. This will surely be one of Jack's favorite days ever.

Happy New Year Y'all!

Posted in General at Jan 02 2008, 10:53:16 AM MST 2 Comments

Part Apple Fan, Part Geek

I like to think I'm not too committed to anything (except my kids and skiing). The following quizzes seem to indicate I'm on the right track. Moderation is good.

52%How Addicted to Apple Are You?
48% Geek

Proof that the holidays are treating me well? I'm heading to the hills for 2 days of skiing with my sister tomorrow. Forecast: Powder. :-D

Posted in Mac OS X at Dec 20 2007, 01:26:53 PM MST 4 Comments

Google Calendar Sync for BlackBerry

Google Sync A couple of days ago, I said the Network Updates feature on LinkedIn's New Homepage is kinda boring. I still agree with this, but I think the new LinkedIn News provides some real value. Today my homepage had a link to Google Calendar Sync for BlackBerry. This is something I've been looking for for quite some time.

If you have a BlackBerry, you can install it from http://m.google.com/sync. I use Spanning Sync to allow me to synch my Google Calendar in iCal and it works awesome. Having a sync to my BlackBerry was the missing part that I really wanted - and now I have it. Thanks LinkedIn! (and Google of course)

As far as LinkedIn's New Homepage, I think the biggest improvement would be to add Atom/RSS Feeds so I could get all my homepage updates (news, network updates and widget updates) in NetNewsWire. I asked about this last week and they said this should be coming in Q1 2008.

Posted in The Web at Dec 12 2007, 01:41:49 PM MST 1 Comment