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.

Struts Training: Week 3

I just signed in for 3rd week here in Struts Training. I'm coming to you live from Chelan, WA. So on with what Ted has to say.

Ted's talking about persistence in Struts: Transaction Script vs. Domain Model.

Transaction Script - organizes business logic by procedure. Great choice for small applications with simple logic. For example, online auction, public search engine or an address book.

Domain Model - an object model of the domain. Has a rich variety of objects that incorporate both data and behavior. Ted mentions that the Domain Model is better for larger applications. For example, managing inventory for an online auction might require using the domain model.

What Ted is doing is using the Domain Model to separate Struts from his Actions - so that he passes around a DomainRequest, DomainResponse, and gets his form from a factory. To me, this looks like a good way to make your Struts layer a lot more complicated! ;-) At the same time, Ted is getting this information from Martin Fowler's Patterns (in Enterprise Architecture, ISBN 0321127420) book, so maybe I should move to the domain model. Naahh, I think I'll keep using the Transaction Script method - it's probably easier for folks to learn and would definitely be easier for rookies to maintain.

Onto Hibernate and how it works:

- POJO beans, encourages fine-grained
- Utilizes "persistence by descriptor"
- Provides DBA-friendly text queries
- Plays well with others
- Buffet-style implementation

IMO, if you're not using Hibernate, you should know why. If you're starting a new project, it's worth looking at. If you're using it, but not using XDoclet - you should be. XDoclet is the best way to avoid DD Hell (quoted from Erik Hatcher).

I didn't know that Hibernate supported a version - did you? Apparently you can specify that a property is a version and Hibernate will use it as you'd expect. Don't see that I have a need for that, but possibly. Would a struts-resume user ever want to keep old versions of their resume? I like to keep old versions of mine, but I have to admit, I never look at them again.

<version name="version" />

Ted just touched on how Hibernate can generate your database schema for you. This is a very powerful feature IMO - especially with struts-resume. It makes it nice for an example app. For instance, with struts-resume, you can run "ant setup-db" and it'll drop tables and re-create your db schema for you.

A student asks about the bottom-up approach - what if you already have a database. My advice? Try looking at Middlegen, its Hibernate Plugin in designed to create an XDoclet-enabled POJO from a database schema. There's also the Reverse Schema Generator that is included with Hibernate. I've used this one and it works great. I've never used Middlegen, but I should be considering that I tag the generated POJO up with XDoclet tags.

Interesting: Ted just mentioned that Gavin (Hibernate's Lead Developer) is working on a book for Manning. It is on Object Relational persistence and it uses Hibernate for its example apps. Erik Hatcher, at his preso on Wednesday, also mentioned that an XDoclet in Action book will be published soon by Manning. He even showed us the book's cover - so I'm assuming it will be published soon.

Hibernate's Fashionable Friends: XDoclet, Commons Logging, Commons DBCP, DynaBeans and Turbine Caching.

To learn more about this Hibernate, checkout:

· AgileData Website (Scott Ambler)
· Hibernate Homepage
· Struts Application Site (Hibernate example and Struts Resume both use Hibernate with Struts)

Vic still likes RowSets and SQL better. I'm guessing this is because he's a SQL expert. The nice thing about Hibernate is that it's query language (HQL) is very much like SQL and allows you to do complex joins. At least, to my knowledge, I've never done any fancy joins in the HQL, just in the mapping (*.hbm.xml) files.

Quote from Ted: This is the year of JUnit books. Watch for them this summer..

Now Ted is covering StrutsTestCase, a JUnit extension that hooks into Struts and Cactus. IMO, it's an awesome way to test Struts Actions - even easier than testing a servlet with Cactus.

Another book: JUnit in Action (Manning) by Vincent Massol and Ted. To be published this summer. Vincent is the lead developer on Cactus, so I expect this to be a great book. Right now, I wish I had written my first book for Manning rather than Wrox. :-(

The one bad part about today's session is that I had to use a calling card to dial in and at $0.35/minute, I'm up to about $25! I should probably sign off soon and save some cash...

Tapestry - are you using it? A student asks about it and Ted mentions that he views it as a presentation framework like Velocity. I've heard lots of good things about it, but have never used it. Ted admits that he uses Velocity and gave up on using JSPs a while ago.

Good stuff - thanks Ted, I'm signing off (the QA session is still in progress).

Posted in Java at Mar 15 2003, 08:37:28 AM MST 1 Comment
Comments:

I think other O/R has been discredited: Castor, EJB, JDO, and Hibreante could be next. From Agile Url url: http://www.agiledata.org/essays/impedanceMismatch.html "your code is likely to run slower due to the greater complexity required to coordinate the differing schemas." He argues that somone on the team should know DB and SQL, if you write a DB app. Just look how ADO.net does it. Slowest part of J2EE is DAO. Weak point for many Java people is SQL. Majority in this case is.... wrong. .V

Posted by Anonymous on March 15, 2003 at 04:33 PM MST #

Post a Comment:
  • HTML Syntax: Allowed