I recently had the opportunity to catch up with Michael Slinn, author of the DZone LiveCycle Data Services (LCDS) ES Refcard, as well as the recently released book, "Flex Data Services, Hibernate and Eclipse" (SlinnBooks). In this interview, recorded at Adobe MAX 2009, Michael talks about the Flex Data Services platform, the differences between LCDS Enterprise Suite (ES) and BlazeDS and provides an overview of some of the new features in LCDS ES 3.
The complete transcript of the interview has been provided below.
DZone: Could you tell us a little bit more about yourself and what you're currently working on?
Michael: Well, most of my life has been consumed with this book for quite some time. It's funny how books take over your life. I'm a long time computer programmer, developer, manager, and have a lot of experience in the Java world. Got mixed up in this Flex stuff when it first appeared, about four years ago, and AIR, when it first appeared, and found that its utility was greatly enhanced when the front-end could talk to the back-end. So the stuff in the middle, which is the middleware, which is what the book is about, is really the part that my background made me well suited to do. I found myself doing that part of every project more than say the front end or the backend. I realized that there were very few other people who knew anything about it, so I decided that's when I thought I'd write the book. Make myself a little bit special.
So, turns out, there's a lot to know about this subject of middleware. It's a middleware book, and I guess you could say I've become a middleware guy. There's no beginning and no end. It's all in the middle.
DZone: What is Flex Data Services and in what scenarios would you say it is most likely to be used?
Michael: Flex Data Services, as I kind of just alluded, is a way to connect clients with servers. To move information from servers to clients and back again, there's a thing called server push. There are many kinds and flavors and different ways to control server push in Flex Data Services, more so than you find in other client-server technologies. Also, you can do remote procedure calls with Flex Data Services, so the client can ask the server to do a job and the response comes back. Flex Data Services is smart about proxies, so you can talk to remote systems through gateways, if you will.
The Flex Data Services, LifecycleDS, and BlazeDS are built on Enterprise Java technology, so if you have Enterprise Java in your IT infrastructure now, then you can take an existing Web app and drop in some JARs.
Possibly the simplest way is just to take a Tomcat app that you currently have, drop in some BlazeDS JARs and write some Flex front end and there you have Flex Data Services you can connect back to Hibernate, other servers, databases, and get very high performance.
DZone: How would you say Lifecycle Data Services ES differs from BlazeDS?
Michael: LCDS is the short term for the mouthful that you phrased there, Lifecycle Data Services ES. So we'll just be friendly amongst ourselves and call it LCDS. There's five differences. You've got DMS. You've got lazy loading. You have NIO. You have PDFs. Those mean something, so Data Management Services or DMS is a way to propagate changes of data between clients and servers.
In other words, a co-browsing experience where you have an application up and I'm your tutor, but I'm a thousand miles away. You can see everything I'm doing. Or maybe it's a help desk thing, where you're having a problem and I can see what you're doing. You would use Data Management Services in that scenario. Difficult to do with other kinds of technologies. So that's build into LCDS. You don't get that with BlazeDS.
Lazy loading is a way of making an app more responsive. If you've got a lot of data to fetch and then when you fetch it, you have to process it and all that takes time. If you're going to get the whole honking wad of data and work on it right away, your application would appear to freeze up for 30 seconds, or who knows how long, before you could do anything. That's unacceptable. So lazy loading says, "Just give me what I need when I need it." I'll get a little bite size chunk and everything will just happen very smoothly.
NIO endpoints, Native IO, is a way to get big scale. If I want to take a little app that I've made using BlazeDS, but now my start-up company has hit the big time. Where you had hundreds of simultaneous users, now you have tens of thousands, you can basically swap out the connectors for NIO connectors. Your app doesn't change. Your backend doesn't change, but you can service so many more clients at the same time. That's when things are going well, NIO is your friend [laughs].
Then the ability to create PDFs. This is kind of interesting for those who think of rich Internet applications as either appearing in a browser or AIR, you can also have a rich Internet application arrive in the mail in the form of a PDF and run it right out of the PDF. Then package everything up, put the data away, and then mail it to the next person. So you could actually have an application with embedded data that travels through some kind of a work flow. That's possible with LifecycleDS, but not with BlazeDS.
Version three of Lifecycle adds a couple things, well, adds several things. Quality of service, so you could say, "I need guaranteed message delivery." I want to make sure this thing goes through no matter what. Or you might say, "I want bandwidth throttling." Could have a lot of data, but I'll tell you the rules whereby which can drop some messages, because I just can't handle it all maybe. Just give me the ones that I care about or as much as I care to receive.
Edge Servers. So, if you have a firewall in an enterprise and you don't want to expose your internal mechanism to the outside world, the Edge Servers could be mediating the contact with the outside world through a DMZ. Clients would connect through the DMZ edge servers, and then they would talk back to central IT structure. You don't get that with BlazeDS. There's data modeling with Version 3, and that's just a higher level way of building your app in a hurry and more reliably.
DZone: What is covered in your new DZone Ref Card on LCDS?
Michael: It provides a brief introduction to LCDS, an orientation. Unlike the book, it assumes that you know something about Flex, because it's a very -- it's the "Reader's Digest" version. We don't have a lot of space. And it assumes you know something about Enterprise Java, as well. So there's a sample project, which demonstrates how data management service works, and it's not a very long one, but it's got some interesting features in there, and it hits some of the high points. And then it's got some reference material, some tables that are summarized, both from the Adobe documentation, and also from the book, in particular, the channels and endpoints, which are fundamental to understanding how Flex data services work.
If you know channels and endpoints and destinations, you've got a solid handle for understanding everything else, but if you don't have that, it's all -- you'll never understand it, because it just seems so vague and tenuous. So that was placed in the reference card, because that's really the fundamental bit. Even though it may not seem so exciting, you've got to be able to walk before you can run.
DZone: What's involved in moving a project from BlazeDS to LCDS?
Michael: Well, that's actually quite a practical question. Often people will start with BlazeDS, because it's open source, and it's free. And they realize, "Hey, we're getting some traction here. Our web application is starting to attract a lot of users, and our server just can't keep up." The thing about BlazeDS is that, it uses blocking IO. Every connection requires a thread, and servers can only handle so many threads, so after hunts, a certain number of hundreds or thousands of threads, you're web server basically grinds to a halt and can't process any more.
Lifecycle DS, with it's NIO capability, can support orders of magnitude more, so all you have to do to switch from BlazeDS to Lifecycle is, first, download Lifecycle, and then there's some jars that were Blaze specific. Replace those with the Lifecycle version. Your configuration file may not need any change. Your Web .xml file will just reference the Lifecycle servelet instead of the BlazeDS servelet. Restart, and there you are. You're in business. It's very simple.
DZone: What do you cover in your book, "Flex Data Services, Hibernate and Eclipse"?
Michael: Well, like I mentioned, it's these channels, endpoints and destinations. Those are definitely the most important concepts that you need to get. So the book comes with a software tool, and it's linked from the reference card, which is the channel designer, which is the visual tool to -- it's actually a Flex application -- to fill out a form. And it builds the XML version of the XML instructions to make the channel. So, you can look at that and watch the tool do the building. As you click on each little widget, it basically makes the change for you. You can show me the defaults and then it blows out into this huge wad of XML, or you can say, "Just assume all the defaults," and it shrinks up again. So you can get a sense of, what am I taking for granted?
One of the things that really bugged me when I would look at a code example, a working project, say, is they've got five lines of code. I'm not sure what they do. It's all magic, because it's all using defaults.
So, when you push the "show defaults" button, it shows you, "Oh, this is really what's been assumed by the program, that, of course, you know, right?" Well, of course, you don't know, so that tool is a good learning aid, and the book of course, covers that. So, to understand just how fundamental that stuff is, is one of the takeaways.
Something else that people are surprised to learn -- there is a myth that says, "Blaze is the free one. LCDS costs a lot of money." But, in fact, it's not quite so simple. If you fit certain criteria, and I'll explain what those are, you can get LCDS on your project for free.
That is to say, it's the same bits as you could pay more money for, but if you have a single CPU with no more than two cores on one web application, and it's a commercial kind of venture or an open source thing, or it's a departmental computing application, you can get a license which doesn't cost any money, and you can use Lifecycle. And so that means you have all the goodies of Lifecycle available. A lot of people don't realize that.
Why that matters is, if you're going to architect an application that needs server push to replicate data between clients and server, and you use BlazeDS to do it, you end up doing a lot of work. You spend a lot time. It's hard. Probably it's full of bugs.
Whereas, if you'd used the data management service in LCDS, things would have gone a lot faster. You could have relied on the infrastructure that's there. You'd get to where you're going much more readily.
And so, gee, wouldn't you feel bad if you find out later that, because you didn't understand how the licensing worked, that you used the open source version instead of the free version of the commercial product, and you spent nine-tenths of the project reinventing data management service, and you weren't really putting your value out into it. So that's definitely one of the takeaways I was wanting people to understand.
And finally, the material in the book right now covers BlazeDS and LifecycleDS, and it's equally applicable to the beta of Lifecycle Version three and the current Version 2.61. It's being updated to have the extra stuff in Version 3, but nothing really changes between 2.61 and 3. There's more that's added.
DZone: So, is the book available for readers to go out and buy right now?
Michael: Indeed. Go to slinnbooks.com. It's been available since July. You will receive, after you send PayPal your money, an email where you can pick up your personalized PDF, a link for the online version of the tool, and there's also an online forum where you can communicate with other readers and myself.
DZone: Michael, on behalf of the Dzone community, I want to thank you for you time today.
Michael: My pleasure.