ArticleslgStudy

computer science

WebSphere sMash

WebSphere sMash is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand WebSphere sMash rather than just read about it. In short: WebSphere sMash was a development and runtime environment from IBM for the creation of dynamic web applications using the scripting languages Apache Groovy and PHP. It contained a PHP runtime written in Java.

WebSphere sMash — main illustration
WebSphere sMash — illustration

Key takeaways

  • WebSphere sMash belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect WebSphere sMash to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of WebSphere sMash from memory before moving on to harder problems.

Reference excerpt

WebSphere sMash was a development and runtime environment from IBM for the creation of dynamic web applications using the scripting languages Apache Groovy and PHP. It contained a PHP runtime written in Java. Project Zero was the experimental software development community in which new versions of WebSphere sMash were incubated. WebSphere sMash was withdrawn from sale in 2012, with support discontinued in 2014. WebSphere Smash integrated with Eclipse and produced REST-style services on top of Groovy or PHP .

Architecture There are a number of distinguishing aspects to the architecture of WebSphere sMash.

Event-driven programming model WebSphere sMash uses an event-driven programming model. Applications are typically composed of a number of small modules which communicate with each other by firing events which are then caught by other handlers that have registered to catch the events. The code firing the event does not have any knowledge of the code that will handle the event. This architecture allows application to be built up from a mixture of code written using PHP, Java, Groovy or the Flow language.

Global context Since events are stateless, a mechanism is required to share data between event handlers. This mechanism is the Global Context. The Global context functions basically as a large map of data divided up into various zones with different lifetimes, properties and persistence.

Repository management system sMash makes use of the Ivy dependency manager. sMash applications are composed of models which can specify dependencies on other modules which may be present in a local Ivy repository or which can be fetched from a remote repository. IBM maintains a repository of useful modules at projectzero.org and dependencies can also be specified on the maven2 repository.

PHP support The PHP support in WebSphere sMash is provided by a PHP runtime implemented in Java. PHP scripts are compiled into Java bytecode which then run on the Java Virtual Machine (JVM). This is similar in concept to the approach taken by other projects such as JRuby and Jython, which run the Ruby and Python languages, respectively, against the JVM. Running on the JVM allows direct, same process calls between PHP, Java and Groovy code allowing applications to be assembled using a variety of languages. In contrast to the approach taken by Quercus, the other JVM based PHP implementation, sMash is able to re-use existing PHP extensions from PHP.net attaching them to the Java virtual machine via the Java Native Interface (JNI) and an API layer called XAPI-C. The runtime has a DBGp debug port allowing debug access from IDEs and debuggers which support the DBGp protocol such as the Eclipse PDT project. The PHP runtime does not have an identity outside of sMash so it is simply referred to as the "WebSphere sMash runtime for PHP." As of October 2008 WebSphere sMash is capable of running several well-known PHP applications on a Java Virtual Machine. These include SugarCRM, phpBB, WordPress and MediaWiki. The PHP runtime supports close integration with the Java and Groovy languages through its Java/Groovy bridge. This allows PHP scripts to use libraries written in Java and Groovy through a lightweight and extremely fast interop layer. The Groovy bridge allows advanced features from Groovy to be accessed directly from PHP. Examples include closures and Groovy metaobjects.

See also PHP/Java Bridge pureQuery Quercus

References

External links OSS Developers: Project Zero Aims for Next-Gen Web Applications IBM WebSphere sMash V1.1.0 brings smart application development to businesses sMash data access with pureQuery

Illustrations

WebSphere sMash illustration

Worked examples

Example 1 — a first encounter with WebSphere sMash

Start with the simplest possible case. Write down what WebSphere sMash claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to WebSphere sMash before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about WebSphere sMash ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of WebSphere sMash

In research
WebSphere sMash appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses WebSphere sMash in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
WebSphere sMash is common in secondary-school and first-year university syllabi. It links to neighbouring topics Discontinued software, IBM WebSphere, Proprietary software programmed in Java, so understanding it makes those chapters shorter.
In everyday life
Look for WebSphere sMash outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “WebSphere sMash” →

How to study WebSphere sMash in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what WebSphere sMash means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain WebSphere sMash out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is WebSphere sMash in simple terms?

WebSphere sMash was a development and runtime environment from IBM for the creation of dynamic web applications using the scripting languages Apache Groovy and PHP. It contained a PHP runtime written in Java.

Why does WebSphere sMash matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study WebSphere sMash?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on WebSphere sMash.

Tags

  • Discontinued software
  • IBM WebSphere
  • Proprietary software programmed in Java
  • Web frameworks

Keep exploring