Recent Posts
Archives

Posts Tagged ‘Zenexity’

PostHeaderIcon [DevoxxFR2013] Live Coding: A WOA Application in 50 Minutes

Lecturer

Guillaume Bort co-founded Zenexity, specializing in Web Oriented Architecture. Previously a J2EE expert, he developed web frameworks for large enterprises, creating Play Framework to prioritize simplicity. He leads Play’s development.

Sadek Drobi, Zenexity’s CTO, focuses on enterprise applications, bridging problem and solution domains. As a programming languages expert, he contributes to Play Framework’s core team.

Abstract

Guillaume Bort and Sadek Drobi’s live coding demonstrates building a Web Oriented Architecture (WOA) application using Play Framework and Scala. Consuming Twitter’s API, they handle JSON, integrate MongoDB, and stream real-time data via Server-Sent Events to an HTML5 interface. The session analyzes reactive programming, asynchronous handling, and scalability, showcasing Play’s efficiency for modern web apps.

Setting Up the Foundation: Play Framework and Twitter API Integration

Bort and Drobi initiate with Play Framework, creating a project via activator. They configure routes for homepage and stream endpoints, using Scala’s async for non-blocking I/O.

Consuming Twitter’s search API: construct URLs with keywords like “DevoxxFR”, include entities for images. Use WS (WebService) for HTTP requests, parsing JSON responses.

They extract tweet data: user, text, images. Handle pagination with since_id for subsequent queries, building a stream of results.

This setup leverages Play’s stateless design, ideal for scalability.

Building Reactive Streams: Enumerators and Asynchronous Processing

To create a continuous stream, they employ Enumerators and Iteratees. Poll Twitter periodically (e.g., every 5 seconds), yielding new tweets.

Code uses concurrent scheduling:

val tweets: Enumerator[Tweet] = Enumerator.generateM {
  Future {
    // Fetch and parse tweets
    Some(newTweets)
  }
}

Flatten to a single stream. Handle errors with recover, ensuring resilience.

This reactive approach processes data as it arrives, avoiding blocking and enabling real-time updates.

Persisting Data: Integrating MongoDB with ReactiveMongo

For storage, integrate ReactiveMongo: asynchronous, non-blocking driver. Define Tweet case class, insert via JSONCollection.

val collection = db.collection[JSONCollection]("tweets")
collection.insert(tweetJson)

Query for latest since_id. Use find with sort/take for efficient retrieval.

This maintains asynchrony, aligning with WOA’s distributed nature.

Streaming to Clients: Server-Sent Events and HTML5 Interface

Output as EventSource: chunked response with JSON events.

Ok.chunked(tweets &> EventSource()).as("text/event-stream")

Client-side: JavaScript EventSource listens, appending images with animations.

Handle dynamics: form submission triggers stream, updating UI.

This enables push updates, enhancing interactivity without WebSockets.

Optimizing for Scalability: Backpressure and Error Handling

Address overload: use onBackpressureBuffer to queue, drop, or fail. Custom strategies compress or ignore excess.

Play’s Akka integration aids actor-based concurrency.

Implications: Builds resilient, scalable apps handling high loads gracefully.

Collaborative Development: Live Insights and Community Resources

Session highlights rapid prototyping: zero slides, GitHub commits for following.

Drobi comments on concepts like futures unification in Scala 2.10, inter-library interoperability.

They encourage exploring Play docs, plugins for extensions.

This methodology fosters understanding of reactive paradigms, preparing for distributed systems.

Links:

PostHeaderIcon [DevoxxFR2013] Web Oriented Architecture: A Transmutation of Practices in Building Information Systems

Lecturer

Habib Guergachi is a Centrale graduate and the CEO and co-founder of Zenexity, established in 2003. As an expert in urbanization, he is among the French architects who introduced key concepts such as the “integrability coefficient” of applications. His professional background includes over seven years at the Central IT Department of AXA, more than three years at the IT Strategy Department of Société Générale, and five years on the executive committee and Technical Direction of a major IT services company. Currently, he leads large-scale urbanization projects and transformations of information systems toward web-oriented models. He also conducts seminars at the prestigious Capgemini Institute.

Abstract

This article explores Habib Guergachi’s lecture on Web Oriented Architecture (WOA), which critiques traditional enterprise practices and advocates for a shift to distributed, hyper-scalable systems. Drawing from historical analogies and real-world examples like LinkedIn, Guergachi argues for abandoning monolithic architectures in favor of independent, reactive applications that leverage modern web protocols. The discussion analyzes the implications for software development, emphasizing innovation, scalability, and the rejection of outdated paradigms to ensure future competitiveness in the French and global IT landscape.

Contextualizing the Shift from Hyper-Integrated to Hyper-Distributed Systems

Guergachi begins by drawing a parallel between the decline of traditional industries, such as steel mills like Gandrange and Florange, and the potential obsolescence of current software engineering practices. He posits that modern IT specialists, akin to specialized workers in software factories, risk irrelevance if they fail to innovate. The core dilemma is the overemphasis on hyper-integrated systems, where enterprises purchase off-the-shelf software that imposes architectures dictated by vendors. This leads to rigid, costly structures that stifle adaptability.

In contrast, Guergachi introduces the concept of hyper-distributed architectures, inspired by web-oriented principles. He illustrates this with a cultural anecdote: a hypothetical Chinese viewer searching for a French film clip on ina.fr fails due to rigid, integrated search mechanisms, while Google succeeds through flexible, distributed intelligence. This highlights how integrated systems, often built around enterprise architecture, application servers, and service buses, create “bousins” – complex, unmaintainable assemblages of tools like CMS for content, transactional plugins, and adapters for legacy JSF applications.

The lecturer critiques the inefficiency of such systems, where decision-making processes involve dumping data into warehouses for analysis, rather than fostering real-time adaptability. He urges a generational shift: respecting past achievements that built foundational information systems but making way for younger developers to construct future-proof ones. Avoiding the trap of using ingenuity merely to bypass imposed integrations is crucial, as technological evolution accelerates.

Principles of Distributed Paradigms and Real-World Implementations

Central to Guergachi’s thesis is the advocacy for distributed paradigms over integrated ones. He references Play Framework, a French-origin technology (despite initial skepticism due to its nationality), as a tool for building independent applications. LinkedIn’s approach exemplifies this: constructing systems as separate components, each focused on core business logic, deployed autonomously. These might use various technologies but prioritize scalability, security, and reactivity.

In a distributed model, non-core functions like search are outsourced to specialized services, allowing internal applications to remain focused and resilient under load. Guergachi explains techniques such as eventual consistency for high-load scenarios and strict consistency only where necessary, like payment processing. Communication between applications relies on RESTful hypermedia over HTTP, rejecting heavy RPC protocols or plugins like Flash, which he derides as symptomatic of a “third-world syndrome” – adopting external technologies without deep understanding.

He envisions enterprises concentrating solely on core business, externalizing storage, CMS, back-office, and video management to superior providers. Performance concerns with HTTP are dismissed as psychological barriers; no in-house solution can compete with storage specialists. Applications will interconnect in a “spaghetti” manner, but one that ensures predictability and adaptability, mirroring the web’s organic structure.

Guergachi introduces entropy as a metaphor: solid (rigid, controlled architectures), liquid (flexible, scalable across servers), and gaseous (pervasive, occupying value chain interstices like Google). Enterprises must evolve toward gaseous states for survival, contrasting with legacy systems that “suck blood” through perpetual maintenance fees.

Implications for Innovation and the Role of French IT Genius

The lecturer delineates integrated paradigms – building overarching technical architectures without functional hypotheses, aiming for longevity – as flawed, akin to overpacking for unforeseen disasters. Distributed paradigms, conversely, tailor architectures per application, prioritizing functional solutions over technical absolutes. For instance, displaying cached content during network failures ensures usability, decided by business logic rather than rigid transactional rules.

A paradigm, per Guergachi, is a coherent worldview offering solutions to its own problems. He warns against half-measures, like deploying advanced frameworks on outdated servers, urging full commitment to distributed models despite risks like dismissal. Submitting to vendor-driven technologies prepares for shameful obsolescence, whereas bold shifts enable glory through innovation.

Critiquing entities like INPI’s outdated systems, he highlights France’s image issues, comparable to 1980s Korean cars. French IT genius, exemplified by talents like Guillaume Bort and Sadek Drobi, must harness business acumen. Concepts like Scalaz originated in France (at Camel), underscoring untapped potential.

The economy of the web remains to be fully realized; Silicon Valley leads but hasn’t won. French informatics must act through innovation serving functionality, user experience, and distributed architectures with increasing entropy. Mastering interconnection complexity yields value, constructing planetary software masterpieces to safeguard jobs and elevate France.

In conclusion, Guergachi’s call to action – rebooting mindsets Monday morning – emphasizes radical change for continuity. By embracing WOA, developers transcend traditional constraints, fostering systems that are open, secure, adaptable, and cost-effective, aligning with business evolutions.

Relevant Links and Hashtags

Links:

PostHeaderIcon [DevoxxFR2012] — Rev:2, Add twitter handle

ALTER TABLE speaker ADD COLUMN twitter varchar(255);


These scripts run automatically on startup, supporting continuous delivery.

## RESTful API Development
James Ward constructs JSON endpoints:

public class ApiController extends Controller {
public Result speakers() {
List speakers = Speaker.find.all();
return ok(Json.toJson(speakers));
}
}


Play’s `Json.toJson` uses Jackson for serialization, with configuration in `application.conf`:

play.modules.enabled += “play.modules.reactivemongo.ReactiveMongoModule”


## Form Handling and Validation
Nicolas demonstrates form binding:

public class FormsController extends Controller {
static Form speakerForm = Form.form(Speaker.class);

public Result create() {
    Form<Speaker> filled = speakerForm.bindFromRequest();
    if (filled.hasErrors()) {
        return badRequest(views.html.create.render(filled));
    } else {
        Speaker speaker = filled.get();
        speaker.save();
        return redirect(routes.Application.index());
    }
}

}


HTML forms use Play’s template engine:

@form(routes.FormsController.create()) {
@inputText(speakerForm(“name”), ‘_label -> “Name”)
@inputText(speakerForm(“twitter”), ‘_label -> “Twitter”)

}


## Frontend Development with HTML5 and JavaScript
Guillaume Bort integrates Twitter Bootstrap and jQuery for responsive design, demonstrating real-time features with WebSockets:

public class StreamController extends Controller {
public WebSocket updates() {
return WebSocket.whenReady((in, out) -> {
// Push updates
});
}
}


## Cloud Deployment to Heroku
James Ward executes deployment:

heroku create devoxx-play-demo
git push heroku master
heroku addons:create heroku-postgresql


Play’s `Procfile` declares the startup command:

web: target/universal/stage/bin/conference-app -Dhttp.port=${PORT}
“`

Implications for Modern Web Development

The presenters conclude that Play 2.0’s integrated toolchain and cloud-ready architecture dramatically accelerate development cycles while producing applications that scale effortlessly in elastic environments.

Links: