Skip Navigation Links

Frequently Asked Questions





The most frequently asked questions about WebSphere sMash are answered in this section. The Overview and the Developer's Guide have a wealth of information also. Feel free to ask your own questions in the Forum.

General FAQ

What is Project Zero?

Project Zero is a technology incubator project centered around agile development and the next generation of dynamic Web applications. The project introduces a simple environment for creating, assembling and running applications based on popular Web technologies. This environment includes a scripting runtime for Groovy and PHP with application programming interfaces optimized for producing REST-style services, integration mash-ups and rich Web interfaces.
back to top

What is WebSphere sMash?

After nearly a year of incubation, we are proud to announce IBM WebSphere sMash and IBM WebSphere sMash Developer Edition. These two products are based on the technology developed here at projectzero.org. The Project Zero community will continue to live as the incubator project, with frequent builds of the latest technology. WebSphere sMash Developer Edition will be a stable build of Project Zero, offered free of charge for development and limited deployment usage to anyone and everyone who wishes to download it. Finally, WebSphere sMash, the commercial product, will give businesses the opportunity to deploy this same innovative technology, to simplify their application creation, and greatly improve their time to value.

The following is a comparison of these three offerings:

  • IBM WebSphere sMash consists of only stable modules for production deployment. WebSphere sMash is available for purchase. See the WebSphere sMash product page at IBM.com for details.
  • IBM WebSphere sMash Developer Edition includes tools useful for developing applications in WebSphere sMash and is free for development and limited deployment (see license for details.)
  • Project Zero gives access to the latest features by defaulting to the experimental modules. Project Zero is free for development and limited deployment (see license for details).

back to top

What is ProjectZero.org?

The Web site, www.projectzero.org, is both an online Web community of people who share an interest in Project Zero and the primary infrastructure used for developing WebSphere sMash. The community is composed of developers, users and other interested parties. The community members seek and share information about the technology, get access to code that can be downloaded, and interact with the development process for WebSphere sMash.

Above all, projectzero.org is an invitation for your feedback, insight, suggestions, criticism, and dialog. We believe this interaction will yield a better solution that is targeted at the problems you have and a technology that truly delivers on its objectives.
back to top

Why is it called Project Zero?

The name Zero is a reminder of the project's aspirations:

  • Zero unnecessary overhead and complexity
  • Zero barriers to success
  • Zero of what you don't need

back to top

Who is the intended audience?

This project and WebSphere sMash are intended for Web developers with scripting skills who want to create useful Web applications quickly and efficiently.
back to top

Why would I be interested?

The innovation here is aimed at enabling faster, more productive development and deployment of Web applications and Web-based services. Its purpose is to allow developers to focus on writing useful code without the distractions of dealing with complex configuration files. Small scripts and well-defined conventions replace conglomerates of code, configuration, and deployment information. To accomplish this, WebSphere sMash provides a great deal of assistance specifically targeted for development of applications using REST patterns. By adhering to REST patterns, developers can increase the interoperability of their components.
back to top

What are the benefits and features?

The innovations in this project give developers the power to create modern Web applications very quickly. This is achieved in several ways. The platform is loosely coupled by design, which fosters componentization and extensive code reuse. Time to value is optimized by maximizing coding efficiency.
back to top

Who is working on this project?

IBM created the initial seeds of this project internally and will continue to drive the development of the technology with feedback and contributions from the community as described in some of the following sections.
back to top

How long has this project been around?

The efforts began in mid 2006 and the www.projectzero.org site went live June 29th, 2007.
back to top

What is the future of this community?

The Project Zero community and this site will continue to serve as an incubator for technologies that speed the development of useful web applications. The code that resides here will continue to be available as a non-commercial entity. Visitors will have access to stable builds (WebSphere sMash Developer Edition), tooling, and the latest features that are not yet available in the commercial WebSphere sMash product.
back to top

Can I contribute?

IBM is following a community driven commercial development process for WebSphere sMash. Feedback and suggestions are welcome. As the community grows, there will be a facility for community members to share reusable components (for example, libraries, widgets and services). This is similar to the way Eclipse plug-ins work in that plug-ins extend the base Eclipse platform, but the plug-in itself is owned by the person or company that developed it.

back to top

If I develop extensions, who owns them?

You do.

back to top

Can I sell my extensions (or applications) that are based on this technology?

Yes. You own the license to your code and can choose to sell the applications or make them available free of charge. You can redistribute the commercial product WebSphere sMash, but not WebSphere sMash Developer Edition or other code available for download on www.projectzero.org.

back to top

Why does IBM think "community driven commercial development" is a good strategy?

The community driven commercial development process is designed to open up IBM's approach to commercial software development by asking customers to weigh in on future product releases as they are being developed. Today, IBM's software development is estimated at 35% open source, leaving 65% of development behind closed doors. We want to build stronger ties to our customers and users, so we're providing a panoramic view of the development process. With regular milestones throughout the development of a release, users get the opportunity to see what is coming, provide feedback, and help set priorities. Suggestions and decisions throughout the development cycle are logged in the public view for educational and historical purposes.

Someone commented that this approach is kind of like going into a restaurant and being able to see the chef prepare your meal. While you can not supply your own ingredients, you do have a say in the end result as it is being cooked.
back to top

Is this an open source project?

We get this question a lot because we make our source code available and we follow a very transparent development process. Project Zero is a commercial project, but we do go about it in a very open way that many have found useful.
back to top

Does this mean IBM will not be pursuing new open source activities?

Of course not. IBM remains committed to open source. This just happens to be one of our commercial projects.
back to top

How much does it cost?

The code available on the projectzero.org site is free, but non-warranted and not supported. It is best used for development and small production deployments. Please refer to the license agreement for further details. The commercial product, WebSphere sMash, is available for larger, production deployments, and comes with world class support from IBM. You can learn more about WebSphere sMash by visiting the WebSphere sMash product page or by contacting our Product Manager at jdlea@us.ibm.com.
back to top

What is the business benefit of developing applications with this technology?

WebSphere sMash simplifies next-generation Web application development and increases developer productivity by providing:

  • A simplified approach to development through the introduction of agile programming and assembly techniques that are attractive to Web developers.
  • A platform optimized around popular technologies found on the Web that are recognized for their ability to lower complexity and shorten development time. This platform uses:
    REST and ATOM
    To form the basis of the service invocation model
    JSON and XML
    For the data interchange format
    Ajax
    As the model for a rich client.
  • Building blocks that enable developers to get applications up and running quickly by leveraging reusable components such as code snippets, widgets, libraries, templates and pre-built services.

back to top

How does this project benefit IBM?

The technology here is designed to make it easier for our customers to quickly build useful applications composed of services and data that reside within services oriented architectures.
back to top

What types of applications can I develop with this technology?

WebSphere sMash lends itself to the development of the next generation of dynamic Web applications. By "Next Generation" we mean applications that incorporate popular "Web 2.0" patterns such as:

  • User contributed content
  • Ratings
  • Tagging
  • Reputation management
  • Richer user experiences

By "dynamic Web applications" we mean Web accessible applications composed of services and feeds, with special assistance provided for applications that make use of increasingly popular Web technologies and approaches to Web development. This includes using REST and ATOM to form the basis of the service invocation model, using JSON and XML as the data interchange format, and using Ajax as the model for a richer client.
back to top

How can I stay updated on the latest news and technologies?

There are several ways to stay informed about the latest offerings, updates, and news about this project:

  • Subscribe to the newsletter.
  • Subscribe to Really Simple Syndication (RSS) feeds.
  • Sign up to "watch" the active discussion forums.

back to top

What if I have questions? What type of support is provided?

Although no official technical support is provided for the code available on www.projectzero.org, we have a Developer FAQ section and a forum where you can ask questions. Your questions will likely be answered by our development teams or by other community members using the same technology.
back to top

How do I report any bugs I find in a technology or suggest additional features?

Bug fixes and suggestions can be reported in the bug tracking system. Be sure to include the details of the bug you are reporting or suggestion you are making, including an example if possible. This information will allow the architects who developed the technology and the community who use it to respond to your concerns.
back to top

How can I download the technology?

See the Downloads section of this Web site. You must then accept the license agreement to download the platform.
back to top





Development FAQ

What platforms are supported?

As this is a technology incubator, all platforms fall under the "try it and give us feedback" model. WebSphere sMash has been tested on Windows™ XP, Linux™ (SLES 10), and Mac. The Java, Groovy, and PHP development languages are supported, as well as assembly techniques and other scripting support.
back to top

What is Groovy?

Groovy is a scripting language that supports Java syntax and provides templating capability. Groovy scripts are converted, under the covers, into Java classes and run in the same JVM as the rest of WebSphere sMash's Java code. Scripts are converted into classes on each request, therefore changes do not require a server restart.
back to top

What value add does WebSphere sMash provide on top of Groovy?

Through the GlobalContext and event infrastructure, the WebSphere sMash core provides an extremely loosely coupled programming model which fosters componentization and reuse. The WebSphere sMash core also provides a convention for arranging scripts on disk in such a way that prescribes their location in an application's URI space. Groovy is one vehicle for plugging into this environment, but on its own is simply a scripting language.
back to top

What development tools can I use to develop WebSphere sMash applications?

App Builder is the preferred tool for developing WebSphere sMash applications. App Builder is a Web-based tool available with WebSphere sMash DE and the latest drivers. Read more about App Builder in the Getting Started Guide.

For system-level development (e.g. Java-based extensions to the WebSphere sMash core), the WebSphere sMash plug-in for Eclipse is also available. Read more in the Getting Started Guide.
back to top

How do I develop a WebSphere sMash application?

The Developer's Guide is a great place to learn about the platform and includes tutorials, demos and samples. Also check the Documentation page and Blogs for additional examples and techniques.
back to top

How do I report any bugs I find in a technology or suggest additional features?

Bug fixes and feature suggestions can be reported in the bug tracking system. Be sure to include the details of the bug you are reporting, including an example if possible. This information will allow the architects who developed the technology and the community who use it to respond to your concerns.
back to top

How do I install and run a WebSphere sMash application?

The fast path to install and run a WebSphere sMash applications:

  1. Unzip the exported package
  2. Type zero start.

For more detailed information, see the Developer's Guide.
back to top

Are there sample applications I can follow?

Yes. There is a collection of sample applications available. Among them is the "employee demo," which is a nice demonstration of REST services. For more details, see the Developer's Guide.
back to top

How do I get a WebSphere sMash application to talk to another WebSphere sMash application?

Two separate applications can communicate using HTTP, specifically REST conventions. For client -> server interactions, this is accomplished using Ajax through JavaScript. For interactions between server processes, Java/PHP based HTTP clients must be used to connect between them.
back to top

What is the security model in WebSphere sMash?

WebSphere sMash implements system-level authentication and authorization. Applications can take advantage of WebSphere sMash's security by defining security rules that determine which resources are protected, by what means they are protected, and what users and groups are allowed to access those resources. You can find more information in the security documentation in the Developer's Guide.
back to top

Can WebSphere sMash be extended?

Yes. The loosely coupled nature of the WebSphere sMash platform fosters componentization, reuse, and extensibility. Extensions can be bundled as self-contained units that include configuration, code, and static Web content. Dependencies are resolved using a technology called Ivy, which means that extensions need not be bundled with all of their dependencies; they must simply be declared in a configuration file.
back to top

What does WebSphere sMash do for database connection management?

Lightweight abstractions on JDBC, zero.data.Manager and zero.data.groovy.Manager, provide an extensible framework and convenience methods for common query patterns. The managers do not attempt to provide complex connection management. You can obtain an instance of a manager using a data source or a physical connection:

  // groovy
  def data = zero.data.groovy.Manager.create('personDb')  // create mgr. on a datasource specified in zero.config
  def data = new zero.data.groovy.Manager(datasource)    // create mgr. on a datasource
  def data = new zero.data.groovy.Manager(connection)    // create mgr. on a connection

  // java
  zero.data.Manager data = zero.data.Manager.create("personDb");// create mgr. on a datasource specified in zero.config
  zero.data.Manager data = new zero.data.Manager(datasource);   // create mgr. on a datasource
  zero.data.Manager data = new zero.data.Manager(connection);   // create mgr. on a connection

The first examples of both Groovy and Java versions use the zero.config file. The create method configures the manager with a data source that is specified in the zero.config file (see the information about configuring data access in the Developer's Guide) for more information).

If a manager is created with a data source, the getConnection() and connection.close() methods are called on every method that requires a connection. If the data source is configured with a connection pool, the getConnection() and connection.close() methods obtain or close a connection, respectively, from the connection pool, thus achieving more resource efficiency. At present, WebSphere sMash does not implement any connection pooling behavior but has been known to work with Apache's DBCP and C3PO, although these configurations are not officially supported.

If a manager is created on a connection, the manager reuses the connection until it is closed (the application developer is responsible for closing the connection). The connection is also held open across method invocations when using certain transaction demarcation methods that are described in the answer to the question on transactions.
back to top

What databases can my WebSphere sMash application use?

WebSphere sMash's zero.data module uses JDBC 3.0 at its core and therefore can connect to any database with JDBC drivers. If you find otherwise, please open a bug. More information on how to configure access to a database can be found in the configuring data access documentation in the Developer's Guide.
back to top

Does WebSphere sMash support transactions?

WebSphere sMash does not support JTA transaction through the use of Transaction Managers or Resource Managers. However, local, single-database transactions are supported. No more functionality beyond JDBC is offered. However, there are conventions and convenience methods that simplify the application code.

The following example illustrates how to execute a group of database operations in one transaction:

def data = zero.data.groovy.Manager.create('personDb')

data.inTransaction{
  data.update(...)
  data.update(...)
  data.queryList(...)
}
If an exception occurs, the group of statements is rolled back. If the closure successfully runs, the group is committed.

You might want more granular control over the group of statements in some situations. The following explicit example is a model of how this is done:

def data = zero.data.groovy.Manager.create('personDb')
data.startTransaction()

try {
  data.update(...)
  data.update(...)
  data.queryList(...)
  data.commitTransaction()
} catch (Throwable e) {
  data.rollbackTransaction()
} finally {
  data.endTransaction()
} 

back to top

What kinds of database queries can I perform?

You can perform any SQL queries that can be sent to the database using JDBC. The manager provides a number of convenience methods that makes running the queries and processing the results easier. For example, the Groovy version of Manager has a quick way to iterate over the results from a query:

def data = zero.data.groovy.Manager.create('personDb')

data.eachRow('SELECT * FROM person') { row ->
  println '-----'
  println row['id']  // use associative array syntax
  println row.name   // or dot notation
}

You can likely achieve most of what you need with these convenience methods:

      query            // perform a query
      queryFirst       // perform a query and return the first row of the result set
      queryList        // perform a query and return the results in a List
      queryArray       // perform a query and return the results in an Array
      queryIterator    // perform a query and return the results as an Iterator

Each of the previous methods is overloaded. ResultSet processing and, therefore, the returned data structure is different based on the method parameters. The following examples use the query API:

// Retrieve data as a List of Map or tuples where the key is the column name
def data = zero.data.groovy.Manager.create('personDb')

def adultFemales = data.queryList('SELECT id, first_name FROM person WHERE age > ? AND sex = ?', [17, 'f'])
// will bind values from the list to SQL

for (person in adultFemales) {
  println person['id']
  println person['last_name']
}

For more advanced use cases, the convenience methods optionally use the RowHandler and ResultHandler interface implementations to fully customize the results processing of the run queries.

See the data access information in the Developer's Guide for more examples.
back to top

Does WebSphere sMash do anything to help maintain the database schema?

Not currently. We are exploring a design (for some time now) and seeking feedback in this area of functionality and would appreciate any input. However, the Zero Resource Model extension can be used to generate database tables for resources using a top down mapping scheme (at the moment the scheme is a simple one-way top down generation scheme with no roundtripping).
back to top

What is Zero Resource Model (ZRM)?

The Zero Resource Model extension refactors resource handlers into a model (that you define) and CRUD/HTTP REST support (provided by ZRM). The motivation for ZRM is to reduce the amount of boilerplate code that is repetitive for basic CRUD patterns. In other words, ZRM enables you to focus your development on the unique attributes of your resource while leveraging ZRM for "the rest of it", including RESTful API, feeds, search, etags, programmatic API, data validation, and more.
back to top

When should I use ZRM versus zero.data.Manager?

ZRM is a great option if you need basic CRUD patterns over REST for top-down mapped data. For applications that need more control or need to access existing databases, the zero.data.Manager remains a viable solution.
back to top

I added a contextRoot to my application, and placed it behind a proxy, and now my application does not work. What happened?

This is probably the result of using absolute URIs, rather than relative URIs, in your application. Now that the relative root of your application has moved, the browser is no longer able to reach the files and resources that are referred to in the browser parsed HTML and JavaScript. For example, when you include Dojo in your application, you should use HTML like in the following example:

<script type="text/javascript" src="dojo.js"></script>

A general rule of thumb is that you should use page relative URIs in all of your static content, and that you should use the APIs provided by URIUtils to create URIs in your dynamic content. This allows the browser to reach the content served by your WebSphere sMash application regardless of the context root where the application is installed. For those instances where you must use absolute URIs, use the URIUtils API to create those absolute links.
back to top





PHP FAQ

What is PHP?

PHP is a widely used and easy to learn scripting language. It is primarily used for writing server side Web applications.

Background information about PHP can be found on this wikipedia site.
back to top

What is WebSphere sMash doing to support PHP?

WebSphere sMash includes an implementation of a runtime to support the PHP language, written in Java.
back to top

Is it a complete PHP implementation?

No. Our intent is to provide a PHP scripting environment for programmers who want to exploit the unique benefits of WebSphere sMash. We have therefore focused on the language level constructs so far, and spent less effort implementing function libraries. At this point, we have a fairly complete implementation of the PHP language. The php.net PHP runtime ships numerous functions with the default distribution, that we have yet to implement. It is our intention, over time, to provide a full set of those library functions and language features that make sense in the WebSphere sMash environment. We are certainly interested in feedback on prioritization of features as we move forward.
back to top

Can it run existing PHP applications?

Given the previous point, we don't believe many existing PHP applications will run unchanged on our implementation. Our focus is on enabling new applications to be developed in an agile fashion using the WebSphere sMash environment rather than on enabling existing applications. That said, we recognize that being able to run existing PHP code, unchanged, is an important contributor to the productivity of a PHP programmer and we want to be able to run some existing PHP applications in the future.
back to top

Does this pass the PHP implementation certification tests? And does it conform to the PHP specification?

PHP does not currently have an implementation certification test, nor a specification. At least, not in the same sense that some other languages do. There are a significant number of test cases available in the php.net PHP source download, we run these so that we can gauge how close we are getting to the php.net PHP implementation. In addition, we set up an IBM team to help complete the PHP test suite, they are writing additional PHP tests and contributing them directly to php.net. The tests that the IBM team are writing have improved the gcov.php.net test coverage for PHP. These tests are already being used by the php.net PHP implementation to further ensure compatibility between php.net PHP releases.
back to top

What PHP functions and language features are currently working ?

Currently supported functions are listed in the core functions information found in the PHP function information in the Developer's Guide. Currently supported language features are listed in the PHP language features information in the Developer's Guide.
back to top

Can WebSphere sMash use the php.net PHP runtime?

Not in the way you would typically think, in that the WebSphere sMash runtime could invoke the php.net PHP runtime to service Web content. Of course, the php.net PHP runtime can be used in the following scenarios:

  • As a client to WebSphere sMash services using HTTP.
  • A WebSphere sMash service implementation could 'shell out' to the php.net PHP runtime to do some processing.
  • A WebSphere sMash service implementation could act as a client to a php.net PHP runtime using HTTP to do some processing.

back to top

Is there any relationship between WebSphere sMash and the php.net PHP runtime?

Not in terms of code sharing for the runtime. The core runtime (the PHP 'virtual machine', if you will) is implemented in Java for our PHP implementation and in C for php.net PHP. The same is true for 'extension' functions. Of course, both implementations can use existing PHP libraries implemented in PHP. For example, the Zend Framework. Note, however, that because of the currently missing base functions it's unlikely that frameworks implemented in PHP will run as you would want them to today.

As previously noted, IBM engineers are contributing tests back to the PHP project, which are directly consumable by the php.net PHP implementation.

We have also spent some time working on the PHP Development Toolkit (PDT) at the Eclipse project, adding function to the PHP debugger to enable it to debug PHP code using the XDebug (dbgP) protocol. Our implementation, in fact, uses the XDebug protocol for it's own debug capabilities.
back to top

How do I get started with PHP and WebSphere sMash?

See the PHP information in the Developer's Guide for more information about PHP. A good tutorial to start with is also available in the documentation.
back to top

Can I develop extensions to PHP in Java?

Yes, the engine has a Java extension API. This allows a Java developer to write new PHP language functions. It also allows a Java developer to leverage the huge number of Java class libraries available. More information on developing extensions can be found in the extending PHP information in the Developer's Guide
back to top

Can I debug PHP applications?

Yes, PHP source code debugging is available in Eclipse.

More information on setting up Eclipse for PHP debugging is available in the Developer's Guide.
back to top





back to top