Thursday, January 12, 2012
WebSphere 2012 Trends And Directions
Just wanted to shoot out a quick pointer to an excellent blog post by our WebSphere CTO, Jerry Cuomo. Jerry talks through our work in mobile platforms, PaaS, DevOps, cloud benchmarking, 20/20 Analytics, Workload Integrated Systems, DataPower-as-a-Service, Internet Scale Computing, Business API management and social business. Also, he has a facebook page to promote discussion of each. Finally he has a SMS app written that allows you to interact with the trends and be notified of updates.
Sunday, November 6, 2011
WebSphere Application Server 8.5 alpa overview session at ApacheCon 2011 in Vancouver BC Thursday November 10
See announcement here
http://na11.apachecon.com/posts/32726152
https://twitter.com/#!/ApacheCon/status/131098166429892609
This will be a presentation and hands-on demo followed by a Q&A session by Eric Covener and Rohit Kelapure.
Monday, October 10, 2011
Java EE 6 and the Spring Framework
Java EE vs Spring Framework Shootout - This session compares the Spring and Java EE stacks in terms of Web frameworks. It re-examines the motivations behind the Spring framework and explores the emergence of the Java EE programming model to meet the challenges posed. The presentation provides insight into when Spring and/or Java EE is appropriate for a building Web applications and if they can coexist.
Best Practices for Migrating Spring Applications to Java EE 6 - The Spring Framework has no doubt played a major role in evolving how we write enterprise applications on the Java platform today, but it is still a proprietary framework owned by a single company. The age of having to rely on such proprietary frameworks in order to develop decent enterprise applications is now over, and using Java EE 6 has become an even easier way to develop enterprise applications based on standards, which makes it the best choice for any enterprise application. In this session, you will experience how to migrate a typical full-stack Spring application to a standards-based, completely portable Java EE 6 application, including integration tests.
Both these presentations bring forth Java EE as a standards based, easier and better alternative to the proprietary Spring Framework. They also cover scenarios of migrating and co-existence with Spring. Please go through these presentations for re-evaluating the usage of Spring Framework in your application stack.
For best practices on integrating the Spring Framework with the WebSphere Application Server please look at the following whitepaper.
Friday, October 7, 2011
Announcing the WebSphere Application Server V8.5 Alpha
The rest is a history that is very much left out of the IBM Centenary literature. However, WebSphere Application Server V8.5 Alpha provides all this and more, using the new Liberty profile. Want to know more? Why not take a look round this new development community, WASdev. You can download the alpha server and tooling. We'd love you to let us know what you think on our forums, and to collaborate with us to help create a next generation development platform that works for you.
Modularity - the next generation of programming
The only way we're going solve this kind of problem is to remove the hierarchical classloader structure in Java and replace it with a managed classloader tree that allows versioning and control resolving dependencies. In other words, we desperately need a modular programming model.
The Java EE platform has known about this issue for some time (since before Java EE 6). It was not addressed in EE 6, but was supposed to be part of the EE 7 discussion. However, as of this month, the Java EE 7 Expert Group has dropped the ball once again on delivering modularity, citing a need for modularity in Java SE first.
However, do not despair. It's extremely unfortunate that EE 7 is not addressing industry concerns, but vendors are providing modular support today in most every app server and OSGi seems to be the predominant form. WebSphere Application Server V8.0 supports building and deploying modular apps and the WebSphere Application Server V8.5 Alpha has a Liberty Profile that shows just how much modular programming is going to change how we program. Think about WebSphere, but with roughly the size and startup speed of Tomcat and an even simpler config model than Tomcat. Best of all, it's OSGi based and gives you the control to resolve dependencies the way you want.
If you want to learn more, see http://www.ibm.com/wasdev and if you want to voice your displeasure in not addressing modular applications in Java EE 7, then send email to the spec leads (found at http://jcp.org/en/egc/view?id=342) or the public comment mailing list, users@javaee-spec.java.net.
Tuesday, June 28, 2011
Great overview of WebSphere Application Server V8.0
He covers the Java EE 6 standards, additional integrated programming models (OSGi, Service Component Architecture, Java Batch, Communications Enabled, and XQuery/XSLT 2.0), additional feature packs (Web 2.0, dynamic scriptiong), system management improvements including installation, high availability, logging, recovery, security and migration.
Well worth the read.
Monday, June 27, 2011
I'm not dead yet
I've been prepping education material for various groups, but I thought I'd take a moment to reflect just how far we've come in improving the platform.
Once UI frameworks start taking advantage of Servlet 3.0 web fragments, it will be a snap to drop a UI framework into a web app and have it auto configured. JSF Facelets are a great improvement on UI composition and reuse. JSF Managed Beans have been split out into their own basic component model that will serve as the core for the platform's future evolution. This means a lean and mean component model that developers can easily grasp and use. The annotated POJO programming model is used everywhere and makes developing and describing components easy. Managed Beans and EJBs now form a graduated component programming model that starts simple and lets you add capabilities as needed with nothing more than an annotation. You can now package your EJBs in your WARs and Contexts and Dependency Injection for EE (CDI) will let you use them as Managed Beans. That means you can start with Managed Beans in your web app today and easily switch to EJBs as needed without repackaging or changing coding patterns. EJBs can be used anywhere a Manage Bean is used and just as easily.
Need to provide access to resources over the web? JAX-RS provides a simple POJO pattern for RESTful services.
Want to stop writing validation logic throughout your application to ensure data integrity? Try Bean Validation and have it done automatically for you.
Lastly, there's a new set of scoped JNDI namespaces that extend beyond java:comp into java:module, java:app, and java:global scopes. These allow a developer to share resources and refs at each of their respective scopes without having to replicate resource declarations in numerous places. It also makes it easier on admins, who only have to bind the shared resources once, instead of everywhere they are used.
I'd have to say that EE 5 and EE 6 have been some of the most productive releases from a developers point of view. This is about as far from being dead as a platform can get. If you haven't tried it yet, pick up a developer or trial edition of WebSphere Application Server v8.0 for free and give it a shot.
Thursday, June 23, 2011
WebSphere ... going Mobile and the Cloud
On cloud, I wanted to point folks to some excellent sources of information on cloud that are by my WebSphere colleagues, but not on this blog.
Jason McGee has alot of demos on his blog that show how the IBM Workload Deployer help you leverage your middleware in the private cloud.
Dustin Amrhein reflects on how these technologies relate to real world deployments on his blog.
Matt Hogstrom has talked about his views of the cloud based as well on his blog.
Last, but not least, Jerry Cuomo has talked about our strategy around cloud and IBM's views on what private cloud means and how to consider performance around cloud (something I'm personally involved with at this point) on his blog.
Please take some time to spin through these blogs and let me know if there are additional aspects of cloud and mobile you'd like to hear from WebSphere folks.
Saturday, June 18, 2011
WAS V8 is Here
First and foremost WAS V8 is a production-ready, fully certified Java EE 6 platform. Some of the primary component technologies, such as JPA 2.0 for persistence and JAX-RS for RESTful Web Services, have been available on WAS V7 through the additive WAS V7 feature packs, and now WAS V8 brings them together as part of our complete Java EE 6 platform support. Building web applications from composable framework technologies is significantly simpler using Servlet 3.0, with the introduction of web fragments. EJB modules can now be packaged directly in WAR archives to simplify the assembly of web applications. The embeddable EJB container continues the simplification of application development, providing a lightweight standalone container for testing EJBs. A common theme here is " development simplification", something further enhanced in WAS V8 with the new monitored directory support for faster compile-edit-debug cycles - drag your new or modified app to the monitored directory and WAS will automatically update or deploy it. Comprehensive Java EE 6 productivity tools are included in RAD v8.0.3, which is also now generally available. Of course, its not all just about Java EE 6. WAS V8 and RAD V8.0.3 support a broad range of programming models to address a wide spectrum of business problems:
- Web applications can be assembled, deployed and managed as OSGi applications to dramatically reduce the size of EARs, increase the reuse of common libraries used by multiple enterprise applications, eliminate version conflicts between applications and enable in-place managed updates of modules of running applications.
- Service Component Architecture (SCA) enables SOA assets to be assembled into coarse-grained composites and to be exposed over a variety of protocol bindings which can be decorated with declarative policies for security, reliability and transactional integrity.
- The Web 2.0 and Mobile feature pack extends the reach of enterprise assets and provides a rich client experience for popular mobile devices including iPhone, Android and Blackberry.
- Communication enabled applications (CEA) simplifies the application use of IP telephony through a catalog of customizable and extensible Web 2.0 widgets.
- Support for batch workloads, alongside standard OLTP workloads, is provided directly in WAS V8 via the POJO-based Java Batch programming model and batch container, consolidating into WAS V8 the core batch support from WebSphere XD Compute Grid. At the same time, a new V8 release of Compute Grid provides enhanced support for massive batch jobs through management of job parallelization as well as managing end-to-end jobs across disparate execution environments such as WAS and CICS.
- Processing large XML documents using XPATH 2.0, XSLT 2.0 and XQuery, exploiting a highly-optimized XML processor and Java XML API for navigating XML data in the most efficient manner.
And its not just raw throughput that is faster in WAS V8. Product installation simplification through use of the IBM Installation Manager (IM) and new template-driven cell creation has reduced product installation time by 15%, large-topology server creation time by 69% and large-topology cluster-creation time by 31%.
Look out for more WAS V8.0 posts soon from the WAS team.
Tuesday, May 3, 2011
Tuning for idleness -- Server Consolidation
With the transition of workloads from dedicated server footprints to big machines which are logically partitioned or hosting hundreds of virtual guests, idle times in one guest or JVM may not necessarily translate to low-utilization of the entire platform. A typical development machine hosting hundreds of developer's guests may have many guests active, but idle. It is important that the idling machines impact overall system performance minimally.
We've written a whitepaper which focuses on how to configure WebSphere V7 to minimize idle-time processing available here. We hope you find the paper informative and helps you reduce the load of idling WebSpheres in your environment.
Monday, April 18, 2011
XML Feature Pack Tech Preview Available
First - XQuery modules is a way to break up larger XQuery based programs into modular units. This was the last optional feature of XQuery not yet supported and rounds out the XQuery 1.0 support. Not only does this feature help you break up your own XQuery programs, but it also allows you to use open source XQuery libraries such as FunctX.
Next is support for easier to bind Java functions. In previous releases you could binding to existing Java logic and data, but now binding to existing Java logic is even easier. The support is common across both XSLT 2.0 and XQuery and supports invocation of both instance and static methods. Here is an example that I showed at Impact:
package org.company;
public class Calculator {
public static int sqrt(int val) {
return (int)Math.sqrt(val);
}
}
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xltxe="http://www.ibm.com/xmlns/prod/xltxe-j"
xmlns:calc="http://com.example/myApp/calculator">
<xltxe:java-extension prefix="calc“ class="org.company.Calculator"/>
<xsl:template match="/">
<xsl:value-of select=“calc:sqrt(64) "/>
</xsl:template>
</xsl:stylesheet>
You can see in the XSLT that using our extention, we were able to map any functions starting with calc to Java calls to org.company.Calculator. Specifically the function sqrt was called in this example. With this support, no Java code is needed to link existing Java logic to an XSLT or XQuery program.
Finally, we spent alot of time on runtime error messages. We have made sure that error messages now include line and column numbers that help you track back to the error that caused execution to fail.
You can read more about these features on developerWorks and download the tech preview from the IBM download site.
Announcing the IBM WebSphere Application Server Migration Toolkit V3.0 Beta
The V3.0 Beta builds upon the capabilities delivered in the V2.1 release, expanding support for migrating your Java Enterprise Edition applications to WebSphere Application Server. The V3.0 Beta continues to enhance the developer's migration experience with new support for migration to WebSphere Application Server V8.0 Beta. Simple remediation tools utilize Rational® source code scanning technology to identify and resolve known application migration issues. This enables developers to quickly identify changes required to migrate from previous product versions or from competitor's Application Server platforms.
More details on the new features and beta program can be found on the IBM WebSphere Application Server V8.0 Beta home page. Just look under Integrated tooling. You can directly Download IBM® WebSphere® Application Server Migration Toolkit v3.0 Beta.
We're excited to continue learning about your experiences with the Beta in the WebSphere Application Server 8 beta forum.
Tuesday, April 5, 2011
WebSphere Application Server V8 Announced
| Planned availability date |
- June 17, 2011 - electronic delivery
- July 22, 2011 - media packs
--> updated link to remove mid-page jump. :-)
Saturday, March 19, 2011
WebSphere Application Server v8.0 Beta, March refresh
For more information on OSGi in the Beta, why not check out this short video on the Enterprise OSGi YouTube channel. http://www.youtube.com/user/EnterpriseOSGi#p/a/u/0/3vRmzqHiJBY
To download the WAS v8.0 Beta and get playing with all the new features, visit the download site here ->
https://www14.software.ibm.com/iwm/web/cc/earlyprograms/websphere/wsasoa/download.shtml
Tuesday, March 8, 2011
Introducing the new Enterprise OSGi YouTube channel.
The short overview presentations are designed to giev the viewer a high level understanding of concepts without going into too much depth. I'll put up links and follow up material which goes into more depth at our main OSGi home at
The new channel can be found at http://www.youtube.com/user/EnterpriseOSGi
Videos available right now on our new Enterprise OSGi channel include:
Big EARs and OSGi - Part 1, by Ian Robinson, IBM, Distinguished Engineer
Big EARs and OSGi - Part 2, by Ian Robinson, IBM, Distinguished Engineer
An Interview with Zoe Slattery, by Zoe Slattery, IBM, OSGi Technical Evangelist
JPA in OSGi, by Tim Ward, IBM, OSGi Applications developer in WAS.
More will be uploaded soon, so why not subscribe to the channel to get notification of when new videos are uploaded. To subscribe, you'll need a YouTube account. Click on the subscribe button on the top left of the Enterprise OSGi channel, shown below.
Friday, February 25, 2011
Great set of articles on Native Memory
Thanks for the memory - Understanding how the JVM uses native memory on Windows and Linux (Windows/Linux version, AIX version).
Troubleshooting native memory issues
Tuesday, February 8, 2011
ONLINE SAMPLES
WebSphere Application Server V8 Beta samples are new and improved and now available for early testing to our WAS V8 Beta customers! Although clients will continue to find key samples installed with the product, additional samples are available online and can be accessed from a new section in the WAS V8 Beta Information Center. Now, samples, documentation, and other resources reside online, under one roof. This will increase availability and collaboration while providing samples in a time-sensitive manner.
Increasing Availability. The sample applications are now on the web, and users can browse individual samples with a direct link or find them using search engines. This is a first for WebSphere Application Server!
Adding Collaboration. As part of the new collaborative information center, users can comment on and rate samples, receive quick feedback, and sign up for updates.
Providing relevant samples in a time-sensitive manner. Online delivery allows samples to be added or updated periodically with regular updates to the information center.
The samples currently available in the Samples section of the WAS V8 Beta Information Center demonstrate the following technologies: Service Component Architecture (SCA), Communications Enabled Applications (CEA), OSGi applications, XML, and Internationalization service.
Monday, January 3, 2011
Help keep posts to this blog active in 2011
Happy New Year WebSphereains!
Thursday, November 11, 2010
System Test Team Reports Available on developerWorks
For example, in a recent report, "Leverage Business Level Applications (BLA) to Improve Management and Operational Capabilities Over Stand-alone Java EE Applications", Feng Yue Li from the WebSphere system test team describes a test scenario that focused on the use of shared libraries within BLAs. She explains how she verified that shared library relationships between BLA composition units work properly when a new version of the BLA asset is rolled out and describes how command assistance can be used with BLAs.
In another recent report, "Test Infrastructure: OSGi FeP and JEE applications", tester Tam Dinh outlines a scenario in which the WebSphere system team deployed, exercised and stressed WebSphere Application Server V7.0 OSGi Feature Pack using three OSGi applications and three JEE applications in a WebSphere Application Server Network Deployment cell.
We'd like to hear your feedback about our work and your ideas about how our testing can be improved. Visit our developerWorks test team wiki and let us know what you think.
Friday, October 8, 2010
New: WebSphere Batch Feature Pack !
This new feature pack provides support for a Java Batch programming model, offers tools and operational controls for Batch workload execution, enables development and deployment of batch applications, and allows concurrent execution of batch and OLTP workloads.
The Batch Feature Pack is targeted toward developers and basic production deployment. It delivers a subset of the functionality of IBM WebSphere Extended Deployment Compute Grid. Batch applications built using the feature pack are fully upward compatible with the Compute Grid environment.
The Compute Grid product offers advanced features, including support for parallel processing, workload scheduler integration, usage accounting, and more. You can start with the Feature Pack (FeP) for Modern Batch and grow it into a full Compute Grid environment. The Batch Deployment Options Chart outlines the functional continuum among these offerings.
Tuesday, October 5, 2010
Joint WAS XML Feature Pack and DB2 pureXML Article on FpML Lives
Programming XML across the multiple tiers, Part 2: Write efficient Java EE applications that exploit an XML database server
This article uses the example of Financial Products Markup Language (FpML) to show how to program realistic native XML across the Application Server and DB2 pureXML. It shows how you can use one consistent programming model (XQuery) and one consistent data model (XML) across data access, transformation, and filtering across both the mid tier and database tier. Using this one data model which doesn't require mapping to Java objects should increase the agility of your XML centric applications as no mapping code needs to be generated or maintained across both tiers.
Even though the article is based upon FpML (which is really useful to the financial sector), the concept is applicable to all industries that have substantial amounts of XML data.
The article has code attached (both a Rational Application Developer ear project and Eclipse/ANT builds) and database load scripts, so you can play with the code to see how it works. All you need to do is define the JDBC resources to point to your DB2 instance. I also have a virtual image for this based upon the free of charge WebSphere Application Server For Developers and DB2 Express-C in case you're interested.
Monday, September 27, 2010
WebSphere V8.0 Beta Feature Focus Weeks
IBM WebSphere Application Server V8.0 Beta Forums
Many include demos and extensive information on the features.
Some topics that recently were discussed include XML Application Programming, SIP Servlets, Communication Enabled Applications, Installation on z/OS, JSP 2.2, JAX-RS, Java EE6 Web Services, EJB 3.1, JPA 2.0, Security Enhancements, and Servlet 3.0.
Many other topics have been discussed as well. Just scroll back through the thread to find and comment on many of the new useful features coming in version 8.0.
Friday, August 13, 2010
A view from the road
Last week I was at Balisage 2010 talking about Web 2.0 and XML discussing how to introduce MVC frameworks into DOJO (and other Web 2.0 widget libraries) that provides all sorts of interesting value add to DOJO. Also once MVC is in place, XML centric models integrate better into the browser. Specifically I discussed Ubiquity XForms. The goal of this work would be a clean XML story of storage to mid tier joins and query that exposed REST/XML in its original form to the browser. This avoids having to write XML to POJO to JSON conversion routines for data that originates and is stored in XML - a common case in many clients I talk to.
This week, I've been between New York and New Jersey. I've been hearing about how the financial and insurance industries work with XML. I've heard about how enterprise content management systems and data storage systems are closely related. I've heard about how XQuery as a general purpose programming model on top of such data is being used. However, I've heard of challenges that relate in linking systems together. I've also heard that having "hybrid servers" that allow XML to bridge into relational and Java systems and JSON is important. Finally, I built a nice VMware based demo of FpML processing across DB2 pureXML and the WebSphere XML Feature Pack. If you're interested in seeing how to efficiently program native XML end to end (whether you're into FpML or not), let me know and we can arrange a demo.
Friday, July 9, 2010
RAD Tooling for OSGi Applications
Built on top of the latest version of Eclipse (Helios), the RAD V8 Beta provides OSGi tools for enterprise Java developers. While most of the development activities, and hence development tools, for enterprise OSGi applications are common with Java EE there are some new considerations. Primarily, these are around the compile-time classpaths, the authoring of new metadata (the OSGi bundle and application manifests) and, optionally, Blueprint bean definition files. RAD introduces new project types for OSGi Bundle projects and OSGi application projects and a variety of new editors and tools for developing components in these types of projects. OSGi modularity semantics are honored in the project build paths to actively encourage modular design: each project has the scope of a single bundle, with Java package visibility between projects restricted to those packages explicitly imported/exported by the project's bundle manifest. This supports the careful and deliberate exposure of only those Java packages that are intended to be used external to a project . RAD's facet-based configuration enables OSGi projects to be configured as OSGi Web projects or OSGi JPA projects and integrates tools for authoring web.xml, persistence.xml and blueprint.xml. OSGi application projects - representing a complete enterprise application consisting of multiple bundles - can be imported from or exported to enterprise bundle archives, and can be tested and debugged on WAS V7 from the RAD workspace. RAD's SCA development tools are also extended to support "OSGi Applications" as a new implementation type for SCA components. The SCA tools accelerate the assembly of SCA composites; these can include OSGi application components wh
ich may selectively expose OSGi services outside the OSGi application and define remote bindings for these services. There's more about the relationship between OSGi services and SCA services here.One of the quickest ways to explore the new OSGi features in RAD is to import one of the sample applications provided with the WAS V7 feature pack into a RAD workspace. The feature pack's Blog Sample, was described in an earlier post so I'll use that as my example. Start RAD and run the File->Import->OSGi Application (EBA) wizard, enterng the location of the com.ibm.ws.eba.example.blog.eba file (found in the WAS_INSTALL/feature_packs/aries/installableApps directory). Since one of the features this sample is designed to show is the deployment of an application which includes content provisioned from a bundle repository, you also need to make the com.ibm.json.java_1.0.0.jar available in the workspace - which you can do through File->Import->OSGi Bundle. The result is 4 OSGi bundle projects and an OSGi application project in the workspace, with everything correctly resolved.
You can see the
relationships between the bundles in this application using RAD's new Bundle Explorer. The figure on the left shows the Bundle Explorer view of the Blog sample application project. Click on the image to enlarge it.RAD gives you all the syntax assist, refactoring support, and problem quick-fixes you expect as well as new editors for bundle manifests, application manifests and blueprint bean definitions. By encapsulating business logic in POJO Blueprint beans and accessing persistent data through JPA entities, unit testing can be performed with simple frameworks like JUnit without requiring an application server to be running. And, of course, RAD includes integrated support for running and debugging entire OSGi applications on a WAS server, straight from the workspace.
WebSphere Application Server V8.0 Beta
There is a download for Windows, Linux, AIX, z/OS, Linux for System Z, HP-UX, and Solaris.
You can find out about the features offered in the beta via the following links:
- Overall "What's New"
- What's new for Installers which includes a new unified installer and customization tools
- What's new for Developers with new servlet, EJB 3.1 JAXB/JAX-WS, JAX-RS, XML centric programming (XPath2/XSLT2/XQuery), SAML support as well as auto-deploy of apps in a monitored directory
- What's new for Administrators and Performance adding web service management support, high performance logging, and enhanced caching under JPA
- What's new for Security which adds security hardening
- What's new for Problem Determination
There are far too many features to list here on the blog, so hopefully the above gives you enough reason to give it a spin. See the InfoCenter for further information.
Go ahead, download the beta, try it out and leave feedback on the forum.
Friday, June 25, 2010
Humor for Friday - Java-4-ever
Watch the Java 4-Ever Video
Now on YouTube
Thursday, June 3, 2010
OSGi applications and JPA2 feature pack has gone GA
- Support for development and deployment of enterprise applications using OSGi
- Support for Enterprise OSGi specs around Web application, Blueprint and JPA
- The ability to update the individual bundles in an OSGi applications
- Support for integrating OSGi and Java EE applications using SCA
- Support for Java Persistence API 2, both from Java EE and OSGi applications
- Development tooling for OSGi and JPA2 via the Rational Application Developer beta
- Good performance increase measured using the SPECjEnterprise2010 benchmark.
Sunday, May 30, 2010
The Cure for XML in Web 2.0?
Here is the abstract:
XForms offers a model-view framework for XML applications. Some developers take a data-centric approach, developing XForms applications by first specifying abstract operations on data and then gradually giving those operations a concrete user interface using XForms widgets. Other developers start from the user interface and develop the MVC model only as far as is needed to support the desired user experience. Tools and design methods suitable for one group may be unhelpful (at best) for the other. We explore a way to bridge this divide by working within the conventions of existing Ajax frameworks such as Dojo.
Interested? Let me know and we can get a review copy of the paper to you. I have talked to many clients that want to integrate their meta data driven XML dominant data to the Web 2.0 work with DOJO and run into the impedance mismatch wall. Hopefully that wall will be coming down soon.
BTW, if you'd like to attend this great conference to hear about this topic and many others on the jam packed agenda, here is a great link to use to convince your management to let you join us in Montreal.
Thursday, May 27, 2010
XQuery: Powerful, Simple, Cool .. "Demo"
First, I have an XML input file of all the downloads over a certain time period. That XML file could come from a web services, a JMS message, or be loaded from a XML database. The data looks something like:
<?xml version="1.0" encoding="UTF-8"?>
<downloads>
<download>
<transaction>1</transaction>
<userid>user1</userid>
<uniqueCustomerId>uid-1</uniqueCustomerId>
<filename>xml_and_import_repositories.zip</filename>
<name>Mr. Andrew Spyker</name>
<email>user@email.com</email>
<companyname>IBM</companyname>
<datedownloaded>2009-11-20</datedownloaded>
</download>
<!-- more download records repeating -->
</downloads>
First I want to quickly get rid of all downloads that have "education" in the filename. Next I want to split the downloads that come from IBM'ers (email or company has some version of IBM in it) vs. the downloads that come from clients. Of those groups, I want to quickly group repeat downloaders (by uniqueCustomerId). I won't include it here, but I've show how to write some of this with Java and DOM in the past. It's sufficient to say that this code is very complex (imagine all the loops through the data you'd write for each of these steps). Let's look at these steps in XQuery:
(: Quickly get rid of education downloads :)
declare variable $allNonEducationDownloads := /downloads/download[not(contains(filename, '/education/'))];
(: Split the IBM downloads from non-IBM downloads :)
declare variable $allIBMDownloads :=
$allNonEducationDownloads[contains(upper-case(email), 'IBM')] |
$allNonEducationDownloads[contains(upper-case(companyname), 'IBM')] |
$allNonEducationDownloads[contains(upper-case(companyname), 'INTERNATIONAL BUSINESS MACHINES')];
(: Get the unique IBM downloader id's :)
declare variable $allIBMUniqueIds := distinct-values($allIBMDownloads/uniqueCustomerId);
(: Get the non-IBM downloads :)
declare variable $allNonIBMDownloads := $allNonEducationDownloads except $allIBMDownloads;
(: Get the unique non-IBM downloader id's :)
declare variable $allINonIBMUniqueIds := distinct-values($allNonIBMDownloads/uniqueCustomerId);
I think the most powerful line of the above code is the "except" statement. In that one quick statement, I can quickly express that we want to take all the downloads and remove the IBM downloads which leaves us with the non-IBM downloads. I think it's quite impressive that XQuery expresses the above statements in about the same amount of lines as the English language I used to describe the requirements.
Additionally, since you are telling the runtime what you want to do instead of how you want to do it, our runtime can aggressively optimize the data access in ways that we couldn't if we had to try to understand the Java byte codes were doing on top of the DOM programming model. Also, since XQuery is functional (the above variables are final) we could span this to multi-core more safely than imperative code as we can guarantee there are no side-effects. This is why, as a performance guy, I think declarative languages are a key to the future of performance.
Back to the code. For people used to XPath 1.0 and its lack of all the built-in schema types, dealing with things as simple as dates was problematic (they were just strings). Here are a few functions that show, with schema awareness, XPath 2.0 and XQuery 1.0 are much more powerful than before:
declare function my:downloadsInDateRange($downloads, $startDate as xs:date, $endDate as xs:date) {
$downloads[xs:date(datedownloaded) >= $startDate and xs:date(datedownloaded) <= $endDate]
};
declare function my:codeDownloadsInDateRange($downloads, $startDate as xs:date, $endDate as xs:date) {
let $onlyCodeDownloads := my:onlyCodeDownloads($downloads)
return my:downloadsInDateRange($onlyCodeDownloads, $startDate, $endDate)
};
These two functions give me a quick way to look for "code" downloads within a date range. In the first function, it's very easy to understand that this functions take the downloads and returns only the subset that has a datedownloaded that is after the start date and before the end date. In the second function, you can see it's easy to call the first function. At this point, I think most Java programmers might be saying "this isn't like what I expected based on my previous work with XSLT". While XSLT is a great language for transformation (XSLT 2.0 even better), I think XQuery gets a little closer to a general purpose language with the ability to declare functions and variables in a more terse syntax.
Finally, let's cover two more important powerful features - FLOWR and output construction. Once I have sliced and diced the data, I need to output the data into a XML report. XQuery gives you a very nice way to mix XML and declarative code as shown below:
declare function my:downloadsByUniqid($uniqid, $downloads) {
for $id in $uniqid
let
$allDownloadsByUniqueId := $downloads[uniqueCustomerId = $id],
$allCodeDownloadsByUniqueId := $downloads[uniqueCustomerId = $id and (contains(filename, 'repositories'))]
return
<downloadById id="{ $id }" codeDownloads="{ count($allCodeDownloadsByUniqueId) }" >
<name>{ data($allDownloadsByUniqueId[1]/name) }</name>
<companyName>{ data($allDownloadsByUniqueId[1]/companyname) }</companyName>
<codeDownloads>
{
for $download in $allCodeDownloadsByUniqueId order by $download/datedownloaded return
<download>
<filename>{ data($download/filename) }</filename>
<datedownloaded>{ data($download/datedownloaded) }</datedownloaded>
</download>
}
</codeDownloads>
</downloadById>
};
This shows how you can create new XML documents and quickly mix in XQuery code. Some people I've talked to think this looks like scripting languages in terms of simplicity. Also, you'll see a For ($id in $uniqid) Let ($allDownloadsByUniqueId, ohters) Return (downloadsById). These three parts make up part of what people call FLOWR (and pronounce flower) which stands for for, let, order by, where, return. The FLOWR statement is a very powerful construct -- able to do all the sorts of joins of data you're used to in SQL -- but in this example I've chosen to show how it can be used to simplify code in the general case where joining data wasn't the focus. For Java people, think of it as a much more powerful looping construct that integrates all the power of SQL for XML.
In the end, I have a 200 line program that takes all the download reports and organizes them by unique IBM vs. unique non-IBM ids and produces a month by month summary. I'd be surprised if you could come up with anything shorter and more maintainable that worked with Java and DOM. I hope this "demo" encourages you to consider using XQuery in your next project where you need to work with data.
Finally, if you find people trying to convince you that XQuery isn't capable enough to be a general language, take a look at a complete ray tracer written in XQuery in a mere 300 lines of code (a real statement of XQuery's power and brevity).
PS. You can download this XQuery program here and some sample input here. You can run them by getting the XML Feature Pack thin client here. The thin client is a general purpose Java based XQuery processor that you can use for evaluation and in production when used with the WebSphere Application Server. All you need to do is download the thin client, unzip and run the below command:
.\executeXQuery.bat -input downloads-fake.xml summary.xq
Wednesday, May 26, 2010
Why the -outputfile switch in XML Thin Client is useful
I was recently working with a set of files that contained non-English Unicode characters and trying to process the data with XSLT 2.0 and XQuery 1.0. I was using the Thin Client for XML that is part of the XML Feature Pack which offers J2SE and command line invocation options for XSLT and XQuery when used in a WebSphere environment.
I did something like:
.\executeXSLT.bat -input input.xml stylesheet.xslt > temp.xml
.\executeXQuery.bat -input temp.xml query.xq > final.xml
And this resulted in something like:
... executeXSLT "works" fine ...
... executeXQuery "fails" with ...
An invalid XML character (Unicode: 0x[8D,3F,E6,8D]) was found in the element content of the document
.
An invalid XML character (Unicode: 0x[8D,3F,E6,8D]) was found in the element content of the document
.
I figured something was wrong with the encodings in the XSLT output method or the xml encoding of the files themselves or -- worse yet -- something wrong with our processor. After some quick thinking by my excellent team, they had me replace the output redirection (where my OS and console got a chance to see/mess with the data between the processor and temp.xml) with the -outputfile option (which allows the processor to directly write to the file) like:
.\executeXSLT.bat -input input.xml -outputfile temp.xml stylesheet.xslt
.\executeXQuery.bat -input temp.xml -outputfile final.xml query.xq
Problem solved. No corruption of the data.
Lesson learned: Keep all the data inside of the processor and don't introduce things (like the Windows Console) into the pipeline that won't honor (or know) the encoding.
Monday, May 3, 2010
New CEA demo videos..
The first one is doing some of the contact center widgets (like click to call then cobrowsing) on the iPhone:
Here is the coshopping between a user on an iPhone and a Desktop:
The next is a shorter and HD version of our JavaScript widget walk through:
Saturday, May 1, 2010
WWW2010/FutureWeb Conference Summary
I was able to hear some technical giants like Sir Tim Berners-Lee, Vint Cerf, Danah Boyd and Doc Searls. I was able to meet up with many people locally (including Paul Jones) as well as folks from across the world working to make the internet move into the future.
The content was as technical as it was social and political. While it's interesting to hear about the Semantic Web and HTML5 and all the cool new areas for search/data mining, it was equally valuable to hear about the impacts the Web is having on education, healthcare, and media to name a few. Also, I hear about the work of many of the conference attendees to change government processes for the better and how involved that can be with the web spanning countries in ways no other technology can/does.
Some reflections on the technical content:
1) Facebook was bashed (a lot). I actually learned that yet again, Facebook had opted me into sharing information without my understanding. The key take away from all of this bashing was that Facebook (and all web technologies) have become a critical part of our culture. The information we all are producing to create value for sites like Facebook/Twitter/etc needs to be treated with care. Marketing folks salivate at the opportunities that this community created content provides. However, just because we can share and use such data in ways that benefit our companies, we shouldn't assume we should.
2) Adobe/Apple was based (a lot). The value of open standards on the web is clear. Some of the stories shared by the panelists were quite interesting -- Talk about how the internet was just a radical idea that would never compete with the "serious networks" of the time prove how valuable standards can be and how they have and will continue to change the world.
3) There was a great presentation by Carl Malamud talking about "Rules for Radicals" that documented 10 rules to make large changes to government and technology, but the rules applied equally well - I can apply them to working within a large corporation. Note that while take aways #1 and #2 got a lot of press, the fact is there were many iPad's, Mac Books and Facebook borne meetups. Carl's presentation showed that we need to work to affect change within these communities. Here is a quick video summary of the rules.
4) I've had it on my TODO list for some time now to look at the building blocks of the Semantic web. I needed to understand how RDF/RDFa and SPARQL relate to XML and XQuery. I'm starting to form some opinions now based upon what I've heard at the conference and the work I've done this week to play with the technologies. I can say with certainty that this Web 3.0 (the web for machines vs. Web 2.0 which was the web for human) and its related technologies - RDF, SPARQL are not going away. I can also say that RDF/SPARQL doesn't compete with XML/XQuery. I can see that we'll need to bridge the gap between these worlds as we look to unleash not only the XML stored in many enterprises but also relational data. We'll also need to do this quickly as this world is moving fast and those people who don't embrace Web 3.0 will be as left behind as those that are still moving towards Web 2.0. An example of this speed that impressed me was the creation of a Facebook Open Graph Protocol vocabulary that was peer edited during a session on Thursday but then live by Friday. Amazing.
5) Twitter is a business tool. I've known this for some time and had success stories, but given the audience of this conference (passionate web technologists) I saw the value of Twitter magnified by at least an order of magnitude. Every academic attendee was communicating via Twitter. I used it to find the IBM attendees and collaborate with them in ways I'm sure I would have missed without Twitter. I used it to meet people I've never met before (even led to a lunch out with Doc Searls and Kathy Gill and another with a local company that is working with SIP technologies). If it wasn't for twitter, I'd say the value of the collaboration at this conference would have been decreased by that same order of magnitude. Another funny story that proves Raleigh is well connected was a fight between two bars on Twitter that broke out trying to earn our patronage for a dinner on the town. If you're a business that isn't paying attention to Twitter are you losing the cost of a few beers or worse?
I'm sure there were more take aways I'll remember, but for now that's a good starting point. If you were at Future Web and had other big take aways, post them in comments.
PS. I got to meet a bunch of great local XML/XQuery folks at the XQuery meet-up I organized. I look forward to collaborating with these folks locally in the future.
Friday, April 30, 2010
Here comes WebSphere CloudBurst 2.0
Just over a year ago, IBM announced the availability of the initial version of the WebSphere CloudBurst Appliance. Today, an announcement signals the coming availability of WebSphere CloudBurst 2.0, and that brings the major release count up to three in a period of about 12 months (the release of 1.1 came at the end of last year).
You can read the announcement for yourself, but here is a quick overview of the new features and enhancements delivered in the latest version:
- WebSphere Process Server support: You can now provision fully functional, virtualized WebSphere Process Server environments using WebSphere CloudBurst. This adds to the existing support for WebSphere Application Server, and the beta and trial versions of WebSphere Portal and DB2 respectively.
- Multi-image pattern support: In previous versions of WebSphere CloudBurst, all patterns mapped to a single virtual image. This meant your custom patterns could only contain parts (or nodes) from a single product. Now you can build patterns that contain parts from multiple different images. This allows you to represent diverse application environments, for instance, one that includes WebSphere Application Server, WebSphere Process Server, and DB2 components, as a single pattern. Of course, this also means installing and initializing these different product components becomes as simple as deploying a single pattern.
- Dynamic system management: During the lifetime of an application environment, it is commonplace to add additional capacity. Specifically for WebSphere environments, this often means adding more nodes and application servers into your landscape. WebSphere CloudBurst 2.0 makes it simple (click of a button) to add more nodes and application servers to a virtual system you previously deployed. Using this new capability, you can quickly scale up your application environment to meet the changing demands of its users. Conversely, you can scale down the environment and remove unnecessary nodes with the simple click of a button as well.
- Intelligence for the runtime: I always talk about the WebSphere intelligence the appliance delivers in terms of deploying and constructing WebSphere application environments. The addition of the WebSphere Application Server Hypervisor Edition Intelligent Management Pack means this intelligence starts to make its way into the runtimes of your application environments. Use the new intelligent management pack to enable a policy-based approach to managing your applications. You can enforce application health actions, govern application response times, and even manage the rollout of new versions of your application with no service disruption.
- New Red Hat WebSphere Application Server Hypervisor Edition: The WebSphere Application Server Hypervisor Edition is a virtual image that includes everything from the operating system all the way to the WebSphere Application Server, pre-installed and pre-configured. Initial versions of this virtual image shipped with Novell SUSE Linux Enterprise Server. Staring in WebSphere CloudBurst 2.0, users can use a new WebSphere Application Server Hypervisor Edition virtual image for VMWare ESX that packages the Red Hat Enterprise Linux Server operating system.
As WebSphere CloudBurst marches forward with new releases, a theme becomes apparent: Give users a choice. What do I mean? Well, just look at where WebSphere CloudBurst stands with the 2.0 release:
- You can use WebSphere CloudBurst to provision environments to VMware ESX, PowerVM, and z/VM hypervisor platforms
- You can use WebSphere CloudBurst to provision WebSphere Application Server, WebSphere Process Server, DB2, and WebSphere Portal
- You can run your virtualized WebSphere application environments on SUSE, Red Hat, AIX, and zLinux operating systems
Want to see more about the 2.0 release? Check out my new video. This much is inarguable: For running WebSphere application environments in an on-premise cloud, nothing comes close to the capabilities of WebSphere CloudBurst.
CEA Impact Sessions
Enabling Cobrowsing and Coshopping on your website - 2040A Tue, 4/May 10:15 AM - 11:30 AM Venetian - San Polo 3506
Adding Rich Interaction Support to your Enterprise Application - 2272A Wed, 5/May 10:15 AM - 11:30 AM Venetian - Lido 3103
Also, we have a lab on Enabling Coshopping and Two Way Forms on your Web Applications with CEA - 2027A Tue, 4/May 04:45 PM - 06:00 PM Venetian - Murano 3304
Finally, here is a less than 3 minute video showing cobrowsing and the new mobile widgets we have made available and will be demoing at Impact here as a tech preview
WebSphere Application Server Feature Pack for Dynamic Scripting
Today we announced a new feature pack for WebSphere Application Server based on WebSphere sMash. This new feature pack delivers the sMash programming model for use on entitled / current subscription WebSphere Application Server V6.1 and V7.0 servers.
Complete details can be found in the IBM.com announcement letter.
When the Feature Pack becomes electronically Generally Available, downloads will be available on the official IBM.com web site for WebSphere Application Server Feature Pack for Dynamic Scripting.
Also being made available through Project Zero, the sMash Enterprise Packager allows WebSphere Application Server V7 to deploy and manage sMash applications through the administrative console as an EAR file. Read more info about this and download the sMash Enterprise Packager on ProjectZero.org.
Find out more about this new Feature Pack and more at IBM Impact 2010.
Based on technology from WebSphere sMash V1.1.1, the feature pack for dynamic scripting provides support for dynamic scripting languages including PHP and Groovy all the while allowing you integrate with AJAX, REST, ATOM, RSS, etc. There is also a resource model as part of the included Zero programming model that simplifies the creation of RESTful services. Want a quick way to create a Web 2.0 application in these languages .. then give this feature pack a try.
Thursday, April 29, 2010
Video Blogs on Impact 2010 Sessions Next Week
I will be presenting on WebSphere XML Strategy. I will be presenting a session on the WebSphere Application Server Feature Pack for XML talking about usage scenarios, how to use the feature pack, and best practices (Sessions 1635A/B on Monday and repeat Thursday). I will also be providing a general education session on XPath 2.0, XSLT 2.0 and XQuery 1.0 (Session 1634 on Tuesday) focused on basic education as well as noting whats new with the standards - with a cool give away! I will be assisting a lab where you can get hands on experience with the XML Feature Pack and the Rational Application Developer tools (Session 1606 on Monday). Stop by any of these session or hit me up on twitter (@aspyker) if you have any questions about XML or data strategy within your enterprise.
Along with the XML Feature Pack and XML strategy talks, I'll be participating in a SOA and BPM Performance update (1321) talking about SPEC SOA and multiple panel discussions around the values of the application server, performance, and feature packs.
You can hear me talk about the sessions here:
Some other videos about sessions next week are available as well.
Erik Kristiansen on RESTful, dynamic scripting, and OSGi programming models:
Lan Vuong on extreme transaction processing and elastic application architectures:

