Recent Posts
Archives

Archive for the ‘General’ Category

PostHeaderIcon [DevoxxFR2013] Arquillian for Simple and Effective Web Tests

Lecturer

Alexis Hassler is a Java developer with over fifteen years of experience. He operates as an independent professional, engaging in coding, training, and supporting enterprises to enhance their Java development and deployment practices. As co-leader of the Lyon Java User Group, he contributes to community events like the Mix-IT conference in Lyon.

Abstract

Alexis Hassler’s session explores Arquillian’s capabilities for testing web applications, extending beyond Java EE components to comprehensive integration testing. Demonstrating extensions like Drone, Graphene, and Warp, he illustrates client-side and server-side testing methodologies. The discussion analyzes setup, execution, and benefits, emphasizing real-world testing that verifies both client interactions and server states for robust applications.

Core Concepts of Arquillian: Integration Testing Reversed

Hassler introduces Arquillian as a tool for integration testing Java EE components, defining a component as an entity like an EJB with injected dependencies, transactional, and security contexts. Unlike embedding containers in tests, Arquillian packages the component with tests and deploys to a container, inverting the process for realistic environments.

A basic test class uses JUnit with an Arquillian runner. The @Deployment annotation creates a testable archive (e.g., WAR) containing classes and resources. Methods like @Test execute within the container, accessing injected resources seamlessly.

This approach ensures tests run in production-like settings, catching issues early. Hassler contrasts with traditional unit tests, highlighting Arquillian’s focus on integrated behaviors.

Extending to Web Testing: Drone and Graphene for Client-Side Interactions

For web applications, Hassler leverages Drone and Graphene extensions, combining Arquillian’s deployment with Selenium’s browser automation. Drone instantiates WebDriver instances; Graphene enhances with guards for AJAX handling.

In setup, specify a managed container like JBoss AS in arquillian.xml. Tests deploy the app, then use @Drone-annotated browsers to interact: navigate via @ArquillianResource URLs, fill forms, assert outcomes.

Graphene’s guards wait for requests, ensuring reliable tests amid asynchronous behaviors. This client-mode testing (@RunAsClient) simulates user interactions, verifying HTTP responses without server-side access.

Code example:

@Drone
WebDriver browser;

@ArquillianResource
URL deploymentUrl;

@Test
@RunAsClient
public void testLogin() {
    browser.get(deploymentUrl + "login.jsf");
    // Interact and assert
}

This deploys, browses, and validates, bridging unit and functional testing.

Advanced Verification with Warp: Bridging Client and Server States

To inspect server-side states during client tests, Hassler introduces Warp. It wraps requests with payloads, executing inspections on the server before/after phases.

Define inspections extending WarpInspection, annotating with @WarpTest. Use @BeforeServlet/@AfterServlet for timing. Deploy via @WarpDeployment.

Example: Verify session attributes post-login. Client triggers action; Warp asserts server-side.

public class SessionInspection extends WarpInspection {
    @AfterServlet
    public void checkSession() {
        // Assert session values
    }
}

Warp enables “real tests” by combining client simulations with server validations, detecting mismatches invisible to pure client tests.

Hassler notes Warp’s alpha status, advising community forums for issues.

Implications for Development Practices: Flexibility and Community Support

Arquillian’s modularity allows mixing modes: @RunAsClient for web, in-container for components. This flexibility suits diverse apps, from simple servlets to complex JSF.

Challenges include initial setup—choosing extensions, versions, resolving conflicts. Documentation is evolving; forums on JBoss.org are responsive, often from developers.

Hassler encourages adoption for effective testing, reducing deployment surprises. Community involvement accelerates learning, fostering better practices.

In essence, Arquillian with extensions empowers thorough, efficient web testing, aligning development with production realities.

Links:

PostHeaderIcon [DevoxxFR2013] NFC: Facilitating Mobile Interactions with the Environment

Lecturer

Romain Menetrier is a developer passionate about internet and mobile platforms. He co-organizes the Paris Android User Group and founded Macala for mobile solutions. Previously CTO at Connecthings, a European NFC leader, he now serves as NFC solutions architect at Orange.

Abstract

Romain Menetrier’s talk introduces Near Field Communication (NFC), tracing its RFID and smart card roots while focusing on mobile implementations, especially Android. He demonstrates practical uses like payments and data exchange, explaining standards, tag types, and Android APIs. Through live examples, he highlights NFC’s security via proximity and contextual potential, advocating its adoption for simplified interactions.

Origins and Fundamentals: From RFID to NFC Standards

Menetrier traces NFC to RFID and contactless cards, operating via magnetic field modulation at under 10cm for security—requiring physical presence. An antenna induces power in passive tags, enabling data return without batteries.

Standards: ISO 14443 (cards), 15693 (tags), with modes like reader/writer (phone reads/writes tags), peer-to-peer (device-to-device), and card emulation (phone as card). Frequencies at 13.56MHz allow small antennas in phones.

Tag types vary: Type 1-4 differ in capacity (48B to 32KB), speed, and protocols. NDEF (NFC Data Exchange Format) standardizes data as records with type, ID, payload—e.g., URLs, text, MIME.

Android drives diffusion: since Gingerbread, APIs handle intents on tag discovery, enabling apps to read/write without foreground requirements via tech-lists.

Practical Implementations: Android Apps for Tag Interaction and Peer-to-Peer

Menetrier demos Android apps: reading tags dispatches intents; apps filter via manifests for specific techs (e.g., NfcA). Reading parses NDEF messages into records, extracting payloads like URLs for browser launch.

Writing: create NDEF records (e.g., URI), form messages, write via NfcAdapter. Locking tags prevents overwrites.

Peer-to-peer uses Android Beam (SNEP protocol): share data by touching devices. Implement via CreateNdefMessageCallback for message creation, OnNdefPushCompleteCallback for confirmation.

Code snippet:

NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this);
adapter.setNdefPushMessageCallback(new CreateNdefMessageCallback() {
    @Override
    public NdefMessage createNdefMessage(NfcEvent event) {
        return new NdefMessage(new NdefRecord[]{createUriRecord("http://example.com")});
    }
}, this);

This enables URL sharing.

Security: short range thwarts remote attacks; presence confirms intent. Contexts from tag locations enhance applications, like venue-specific info.

Everyday Applications and Future Prospects: Payments, Access, and Tracking

Common uses: payments (e.g., Cityzi in France, emulating cards via SIM-secured elements), transport (Navigo integration), access control (badges). Tags in ads track interactions, gauging interest beyond views.

Enterprise: unified NFC cards for canteen, entry—multiple IDs on one chip. Phones emulate cards, even off (via SIM linkage), blockable remotely.

Challenges: ecosystem fragmentation (operators control SIM), but growing adoption. Menetrier sees NFC simplifying interactions, with Android pivotal.

In summary, NFC’s proximity fosters secure, contextual mobile-environment links, poised for widespread use.

Relevant Links and Hashtags

Links:

PostHeaderIcon [DevoxxBE2012] When Geek Leaks

Neal Ford, a software architect at ThoughtWorks and author known for his work on enterprise applications, delivered a keynote exploring “geek leaking”—the spillover of deep expertise from one domain into another, fostering innovation. Neal, an international speaker with insights into design and delivery, tied this concept to his book “Presentation Patterns,” but expanded it to broader intellectual pursuits.

He defined “geek” as an enthusiast whose passion in one area influences others, creating synergies. Neal illustrated with examples like Richard Feynman’s interdisciplinary contributions, from physics to biology, showing how questioning fundamentals drives breakthroughs.

Neal connected this to software, urging developers to apply scientific methods—hypothesis, experimentation, analysis—to projects. He critiqued over-reliance on authority, advocating first-principles thinking to challenge assumptions.

Drawing from history, Neal discussed how paradigm shifts, like Galileo’s heliocentrism, exemplify geek leaking by integrating new evidence across fields.

In technology, he highlighted tools enabling this, such as domain-specific languages blending syntaxes for efficiency.

Origins of Intellectual Cross-Pollination

Neal traced geek leaking to Feynman’s life, where physics informed lock-picking and bongo playing, emphasizing curiosity over rote knowledge. He paralleled this to software, where patterns from one language inspire another.

He referenced Thomas Kuhn’s “Structure of Scientific Revolutions,” explaining how anomalies lead to paradigm shifts, akin to evolving tech stacks.

Applying Scientific Rigor in Development

Neal advocated embracing hypotheses in coding, testing ideas empirically rather than debating theoretically. He cited examples like performance tuning, where measurements debunk intuitions.

He introduced the “jeweler’s hammer”—gentle taps revealing flaws—urging subtle probes in designs to uncover weaknesses early.

Historical Lessons and Modern Tools

Discussing Challenger disaster, Neal showed Feynman’s simple demonstration exposing engineering flaws, stressing clarity in communication.

He critiqued poor presentations, linking to Edward Tufte’s analysis of Columbia shuttle slides, where buried details caused tragedy.

Neal promoted tools like DSLs for expressive code, and polyglot programming to borrow strengths across languages.

Fostering Innovation Through Curiosity

Encouraging geek leaking, Neal suggested exploring adjacent fields, like biology informing algorithms (genetic programming).

He emphasized self-skepticism, quoting Feynman on fooling oneself, and applying scientific method to validate ideas.

Neal concluded by urging first-principles reevaluation, ensuring solutions align with core problems, not outdated assumptions.

His keynote inspired developers to let expertise leak, driving creative, robust solutions.

Links:

PostHeaderIcon [DevoxxFR2013] FLATMAP ZAT SHIT: Monads Explained to Geeks

Lecturer

François Sarradin is a Java and lambda developer, serving as a technical capitalization manager. He contributes to the Brown Bag Lunch initiative, sharing expertise through presentations.

Abstract

François Sarradin’s session introduces monads in functional programming, using Scala and Java 8 examples to demystify their utility. He addresses handling errors, asynchrony, and technical concerns without cluttering business logic, employing monadic structures like Try and Future. The talk analyzes code transformations for cleaner, composable designs, highlighting monads’ role in aspect-oriented programming and drawing parallels to AOP frameworks.

The Problem: Technical Debt Obscuring Business Logic

Sarradin illustrates a common plight: initial clean code accumulates technical safeguards—null checks, try-catch blocks, synchronization—eroding readability and productivity. He proposes separating concerns: keep business logic pure, inject technical aspects via mechanisms akin to aspect-oriented programming (AOP).

Using AOP tools like AspectJ or Spring AOP declares cross-cutting concerns (e.g., logging, error handling) separately, leveraging compilers for coherence. This maintains original code structure while addressing realities like exceptions or async calls.

An example application in Scala computes total balance across bank accounts, initially straightforward but vulnerable. Technical intrusions (e.g., if-null, try-catch) bloat it, prompting a search for elegant solutions.

Introducing Monads: Error Handling with Try

To manage errors without pervasive checks, Sarradin introduces the Try monad in Scala: a container wrapping success (Success(value)) or failure (Failure(exception)). This allows chaining operations via flatMap and map, propagating errors implicitly.

Transforming the balance app: wrap account retrieval in Try, use for-comprehensions (sugaring flatMap/map) for composition. If any step fails, the whole computation fails gracefully, without explicit exception handling.

Code evolves from imperative checks to declarative chains:

val total = for {
  account1 <- Try(getAccount(bank1))
  account2 <- Try(getAccount(bank2))
  balance1 <- Try(getBalance(account1))
  balance2 <- Try(getBalance(account2))
} yield balance1 + balance2

This yields Try[Double], inspectable via isSuccess, get, or getOrElse. Monads here abstract error propagation, enhancing modularity.

Java 8’s Optional partially mirrors this but lacks full monadic power; Sarradin implements a custom Try for illustration, using abstract classes with Success/Failure subclasses.

Extending to Asynchrony: Futures for Non-Blocking Computations

Asynchrony poses similar issues: callbacks or blocking awaits disrupt flow. Scala’s Future monad encapsulates eventual values, enabling composition without blocking.

In the app, wrap async calls in Future: use flatMap to chain, ensuring non-blocking execution. For-comprehensions again simplify:

val totalFuture = for {
  account1 <- Future(getAccountAsync(bank1))
  account2 <- Future(getAccountAsync(bank2))
  balance1 <- Future(getBalanceAsync(account1))
  balance2 <- Future(getBalanceAsync(account2))
} yield balance1 + balance2

totalFuture completes asynchronously; callbacks via onComplete handle results. This maintains sequential appearance while parallelizing under the hood.

Sarradin contrasts with Java 8’s CompletableFuture, which offers thenApply/thenCompose for similar chaining, though less idiomatic without for-comprehensions.

Monads as a Unifying Abstraction: Synthesis and Implications

Monads generalize: a type M[A] with map (transform value) and flatMap (chain computations). They inject contexts (error, future) into pure functions, separating concerns.

In the app, combining Try and Future (via Scalaz’s EitherT or custom) handles both errors and asynchrony. This AOP-like injection leverages type systems for safety, contrasting annotation-based AOP.

Java 8 approximates with lambdas and CompletableFuture/Optional, but lacks Scala’s expressiveness. Custom implementations reveal monads’ essence: abstract class with map/flatMap, subclasses for Success/Failure.

Sarradin concludes monads enhance composability, reducing boilerplate for robust, maintainable code in functional paradigms.

Relevant Links and Hashtags

Links:

PostHeaderIcon [DevoxxFR2013] NIO, Not So Simple?

Lecturer

Emmanuel Lecharny is a member of the Apache Software Foundation, contributing to projects like Apache Directory Server and Apache MINA. He also mentors incubating projects such as Deft and Syncope. As founder of his own company, he collaborates on OpenLDAP development through partnerships.

Abstract

Emmanuel Lecharny’s presentation delves into the intricacies of network input/output (NIO) in Java, contrasting it with blocking I/O (BIO) and asynchronous I/O (AIO). Through detailed explanations and code examples, he explores concurrency management, scalability, encoding/decoding, and performance in building efficient servers using Apache MINA. The talk emphasizes practical challenges and solutions, advocating framework use to simplify complex implementations while highlighting system-level considerations like buffers and selectors.

Fundamentals of I/O Models: BIO, NIO, and AIO Compared

Lecharny begins by outlining the three primary I/O paradigms in Java: blocking I/O (BIO), non-blocking I/O (NIO), and asynchronous I/O (AIO). BIO, the traditional model, assigns a thread per connection, blocking until data arrives. This simplicity suits low-connection scenarios but falters under high load, as threads consume resources—up to 1MB stack each—leading to context switching overhead.

NIO introduces selectors and channels, enabling a single thread to monitor multiple connections via events like OP_READ or OP_WRITE. This non-blocking approach scales better, handling thousands of connections without proportional threads. However, it requires manual state management, as partial reads/writes necessitate buffering.

AIO, added in Java 7, builds on NIO with callbacks or futures for completion notifications, reducing polling needs. Yet, it demands careful handler design to avoid blocking the callback thread, often necessitating additional threading for processing.

These models address concurrency differently: BIO is straightforward but resource-intensive; NIO offers efficiency through event-driven multiplexing; AIO provides true asynchrony but with added complexity in callback handling.

Building Scalable Servers with Apache MINA: Core Components and Configuration

Apache MINA simplifies NIO/AIO development by abstracting low-level details. Lecharny demonstrates a basic UDP server: instantiate IoAcceptor, bind to a port, and set a handler for messages. The framework manages buffers, threading, and protocol encoding/decoding.

Key components include IoService (for acceptors/connectors), IoHandler (for events like messageReceived), and filters (e.g., logging, protocol codecs). Configuration involves thread pools: one for I/O (typically one thread suffices due to selectors), another for application logic to prevent blocking.

Scalability hinges on proper setup: use direct buffers for large data to avoid JVM heap copies, but heap buffers for small payloads in Java 7 for speed. MINA’s executor filter offloads heavy computations, maintaining responsiveness.

Code example:

DatagramAcceptor acceptor = new NioDatagramAcceptor();
acceptor.setHandler(new MyHandler());
SocketAddress address = new InetSocketAddress(port);
acceptor.bind(address);

This binds a UDP acceptor, ready for incoming datagrams.

Handling Data: Encoding, Decoding, and Buffer Management

Encoding/decoding is pivotal; MINA’s ProtocolCodecFilter uses encoders/decoders for byte-to-object conversion. Lecharny explains cumulative decoding for fragmented messages: maintain a buffer, append incoming data, and decode when complete (e.g., via length prefixes).

Buffers in NIO are crucial: ByteBuffer for data storage, with position, limit, and capacity. Direct buffers (allocateDirect) bypass JVM heap for zero-copy I/O, ideal for large transfers, but allocation is costlier. Heap buffers (allocate) are faster for small sizes.

Performance tests show Java 7 heap buffers outperforming direct ones up to 64KB; beyond, direct excels. UDP limits (64KB max) favor heap buffers.

Partial writes require looping until completion, tracking written bytes. MINA abstracts this, but understanding underlies effective use.

public class LengthPrefixedDecoder extends CumulativeProtocolDecoder {
    protected boolean doDecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) {
        if (in.remaining() < 4) return false;
        int length = in.getInt();
        if (in.remaining() < length) return false;
        // Decode data
        return true;
    }
}

This decoder checks for complete messages via prefixed length.

Concurrency and Performance Optimization in High-Load Scenarios

Concurrency management involves separating I/O from processing: MINA’s single I/O thread uses selectors for event polling, dispatching to worker pools. Avoid blocking in handlers; use executors for database queries or computations.

Scalability tests: on a quad-core machine, MINA handles 10,000+ connections efficiently. UDP benchmarks show Java 7 20-30% faster than Java 6, nearing native speeds. TCP may lag BIO slightly due to overhead, but NIO/AIO shine in connection volume.

Common pitfalls: over-allocating threads (match to cores), ignoring backpressure (queue overloads), and poor buffer sizing. Monitor via JMX: MINA exposes metrics for queued events, throughput.

Lecharny stresses: network rarely bottlenecks; focus on application I/O (databases, disks). 10Gbps networks outpace SSDs, so optimize backend.

Practical Examples: From Simple Servers to Real-World Applications

Lecharny presents realistic servers: a basic echo server with MINA requires minimal code—set acceptor, handler, bind. For protocols like LDAP, integrate codecs for ASN.1 encoding.

In Directory Server, NIO enables handling massive concurrent searches without thread explosion. MINA’s modularity allows stacking filters: SSL for security, compression for efficiency.

For UDP-based services (e.g., DNS), similar setup but with DatagramAcceptor. Handle datagram fragmentation manually if exceeding MTU.

AIO variant: Use AsyncIoAcceptor with CompletionHandlers for callbacks, reducing selector polling.

These examples illustrate MINA’s brevity: functional servers in under 50 lines, versus hundreds in raw NIO.

Implications and Recommendations for NIO Adoption

NIO/AIO demand understanding OS-level mechanics: epoll (Linux) vs. kqueue (BSD) for selectors, impacting portability. Java abstracts this, but edge cases (e.g., IPv6) require vigilance.

Performance gains are situational: BIO suffices for <1000 connections; NIO for scalability. Frameworks like MINA or Netty mitigate complexity, encapsulating best practices.

Lecharny concludes: embrace frameworks to avoid reinventing; comprehend fundamentals for troubleshooting. Java 7+ enhancements make NIO more viable, but test rigorously under load.

Relevant Links and Hashtags

Links:

PostHeaderIcon [DevoxxBE2012] Weld-OSGi in Action

Mathieu Ancelin and Matthieu Clochard, software engineers at SERLI specializing in Java EE and modular systems, showcased the synergy between CDI, OSGi, and Weld in their Weld-OSGi framework during DevoxxBE2012. Mathieu, a member of the CDI 1.1 expert group and contributor to projects like GlassFish, collaborated with Matthieu, who focuses on OSGi integrations, to demonstrate how Weld-OSGi simplifies dynamic application assembly without added complexity.

They started with CDI basics, where dependency injection manages component lifecycles via annotations like @Inject. OSGi’s modularity, with bundles as deployment units and a dynamic service registry, complements this by allowing runtime changes. Weld-OSGi bridges them, enabling CDI beans to interact seamlessly with OSGi services.

A demo illustrated bootstrapping Weld-OSGi in an OSGi environment, registering bundles, and using extensions for event handling. They emphasized transparent service interactions, where CDI observes OSGi events for dynamic updates.

Mathieu and Matthieu highlighted Weld-OSGi’s role in making OSGi accessible, countering perceptions of its difficulty by leveraging CDI’s programming model.

Fundamentals of CDI and OSGi Integration

Mathieu explained CDI’s bean management, scopes, and qualifiers for precise injections. Matthieu detailed OSGi’s bundle lifecycle and service registry, where services publish and consume dynamically.

Weld-OSGi embeds CDI containers in OSGi, using extensions to observe bundle events and register services as beans. This allows injecting OSGi services into CDI components effortlessly.

Dynamic Features and Practical Demonstrations

They demonstrated service dynamism: publishing a service updates dependent beans automatically. Unpublishing triggers alternatives or errors, ensuring robustness.

Demos included hybrid applications where Java EE components interact with OSGi bundles via the registry, deploying parts dynamically without restarts.

Future Prospects and Community Engagement

Mathieu discussed ongoing work for hybrid servers like GlassFish, embedding Weld-OSGi for cleaner integrations. They referenced RFC 146, inspired by Weld-OSGi, for native CDI-OSGi support.

Encouraging trials, they pointed to GitHub repositories with examples and documentation, fostering feedback to evolve the framework.

Mathieu and Matthieu’s presentation illustrated Weld-OSGi’s potential to create fully dynamic modular applications, blending CDI’s elegance with OSGi’s power.

Links:

PostHeaderIcon [DevoxxFR2013] The Space Mountain of Enterprise Java Development

Lecturer

Florent Ramière brings over a decade of software development and project management experience. After years in the US at a software editor and a stint at Capgemini upon returning to France, he co-founded Jaxio with Nicolas Romanetti in 2005. Jaxio offers code generation via Celerio; in 2009, they launched SpringFuse.com, an online version. Active in Paris Java scenes like ParisJUG and Coding Dojos.

Abstract

Florent Ramière’s dynamic demonstration navigates enterprise Java development’s complexities, showcasing tools like Maven, Spring, JPA, and more in a live Eclipse session. Emphasizing practical efficiencies for data-heavy applications, he covers CRUD operations, testing, profiling, and CI. The talk reveals techniques for rapid, robust development, highlighting simplicity’s challenges and offering actionable insights for real-world projects.

Setting the Stage: Tools and Environment for Efficient Development

Ramière begins with audience polling: most work on Java EE/Spring applications involving databases, often exceeding 100 tables. He focuses on large-scale management apps, sharing experiences from consulting across projects.

Demonstrating in Eclipse with Jetty embedded, he launches an internationalized app using an in-memory database for independence. Maven builds the project; SpringFuse aggregates best practices.

Key promise: simplicity is hard; knowing tools accelerates work. If nothing new learned, a Mojito offered – or a fun fact on calculating light speed with chocolate.

The app handles accounts: listing, searching, navigating. CRUD dominates; business logic intersperses.

Core Operations: Querying, Validation, and Data Manipulation

Search uses query-by-example: fields like ‘admin’ or ‘Tokyo’ filter results. JPA with Hibernate enables this; Bean Validation ensures integrity.

Editing involves JSF with PrimeFaces for UI: dialogs, calendars, auto-completes. Commons and Guava libraries aid utilities; Lombok reduces boilerplate.

Saving triggers validations: required fields, formats. Excel exports via JXLS; imports validate before persisting.

Full-text search with Hibernate Search (Lucene) indexes entities, supporting fuzzy matches and facets.

@Entity
@Indexed
public class User {
    @Id
    private Long id;
    @Field(index=Index.YES, analyze=Analyze.YES)
    private String name;
    // ...
}

This annotates for indexing, enabling advanced queries.

Testing and Quality Assurance: From Unit to Integration

JUnit with Fest-Assert and Mockito tests services: mocking DAOs, verifying behaviors.

Selenium with Firefox automates UI tests: navigating, filling forms, asserting outcomes.

JMeter scripts load tests: threading simulates users, measuring throughput.

Sonar integrates for code reviews: violations, discussions directly in Eclipse.

@Test
public void testService() {
    User user = mock(User.class);
    when(user.getName()).thenReturn("Test");
    assertEquals("Test", service.getUserName(1L));
}

Mockito example for isolated testing.

Performance and Deployment: Profiling and Continuous Integration

JProfiler attaches for heap/thread analysis: identifying leaks, optimizing queries.

Hudson (now Jenkins) builds via Maven: compiling, testing, deploying WARs.

iSpace visualizes dependencies, aiding architecture.

Profiles manage environments: dev/test/prod configurations.

Navigating Complexities: Best Practices and Pitfalls

Ramière advises command-line Maven for reliability; avoid outdated WTP.

For large schemas, tools like SpringFuse generate CRUD, reducing tedium.

NoSQL suits big data, but relational fits structured needs; patterns transfer.

Embrace profiles for configurations; Git for code reviews alongside Sonar/Gerrit.

Impact of profilers on tests: significant, but use for targeted optimizations via thread dumps.

In conclusion, enterprise Java demands tool mastery for efficiency; simplicity emerges from knowledge.

Links:

PostHeaderIcon [DevoxxBE2012] The Chrome Dev Tools Can Do THAT

Ilya Grigorik, a Google web performance engineer and developer advocate, unveiled advanced capabilities of Chrome Developer Tools. Ilya, focused on accelerating the web, overwhelmed attendees with tips, dividing into inspection/debugging and performance analysis.

He encouraged hands-on exploration via online slides, emphasizing tools’ instrumentation for pinpointing bottlenecks.

Starting with basics, Ilya showed inspecting elements, modifying DOM/CSS live, and using console for JavaScript evaluation.

Advanced features included remote debugging for mobile, connecting devices to desktops for inspection.

Inspection and Debugging Essentials

Ilya demonstrated breakpoints on DOM changes, XHR requests, and events, pausing execution for analysis.

Color pickers, shadow DOM inspection, and computed styles aid UI debugging.

Console utilities like $0 for selected elements, querySelector, and table formatting enhance interactivity.

JavaScript Profiling and Optimization

CPU profilers capture call stacks, revealing hot spots. Ilya profiled loops, identifying inefficiencies.

Heap snapshots detect memory leaks by comparing allocations.

Source maps map minified code to originals, with pretty-printing for readability.

Network and Resource Analysis

Network panel details requests, with filters and timelines. Ilya explained columns like status, size, showing compression benefits.

WebSocket and SPDY inspectors provide low-level insights.

HAR exports enable sharing traces.

Timeline and Rendering Insights

Timeline records events, offering frame-by-frame analysis of layouts, paints.

Ilya used it to optimize animations, enabling GPU acceleration.

CSS selectors profile identifies slow rules.

Auditing and Best Practices

Audits suggest optimizations like minification, unused CSS removal.

Extensions customize tools further.

Low-Level Tracing and Customization

Chrome Tracing visualizes browser internals, instrumentable with console.time for custom metrics.

Ilya’s session equipped developers with powerful diagnostics for performant, debuggable applications.

Links:

PostHeaderIcon [DevoxxFR2013] Animate Your HTML5 Pages: A Comprehensive Tour of Animation Techniques in HTML5

Lecturer

Martin Gorner is passionate about science, technology, coding, and algorithms. He graduated from Mines Paris Tech and spent early years in ST Microelectronics’ computer architecture group. For 11 years, he shaped the eBook market via Mobipocket, which became Amazon Kindle’s software core. Joining Google Developer Relations in 2011, he focuses on entrepreneurship outreach.

Abstract

Martin Gorner’s lecture surveys HTML5’s four animation technologies: CSS3 and SVG for declarative approaches, Canvas and WebGL for programmatic ones. Through live demonstrations and explanations, he elucidates their strengths, limitations, and applications, emphasizing fluidity for user interfaces akin to mobile apps. The presentation, itself HTML5-based, covers transitions, transformations, and shaders, offering practical insights for enhancing web experiences.

Declarative Animations with CSS3: Simplicity and Power

Gorner introduces CSS3 as straightforward: the ‘transition’ property interpolates between states when a CSS value changes. A JavaScript snippet swaps classes (‘begin’ to ‘end’), shifting position and rotation; specifying ‘transition: 1s’ yields smooth 60fps animation.

For continuous loops, ‘animation’ references a ‘@keyframes’ block defining CSS at percentages (0%, 10%, etc.). Over 3 seconds, it interpolates, applying left shifts, scales, and rotations.

Animatable properties include border thickness, opacity (for fades), and geometric transformations via ‘transform’: rotate, scale, skew (distorting axes). Default easing provides appealing velocity profiles; ‘ease-in-out’ accelerates/decelerates naturally.

Prefixes (e.g., -webkit-) are needed for non-standardized specs; tools like prefixfree.js or SASS automate this. CSS3 suits simple, event-triggered or looping effects but lacks complex paths or programmatic control.

Enhancing Vector Graphics: SVG’s Declarative Animation Capabilities

SVG, for vector drawings, supports declarative animations via tags. Paths define curves; animations alter attributes like ‘d’ for shapes or ‘transform’ for motion.

Keyframes in SVG mirror CSS but embed in elements. Motion follows paths with , rotating optionally. Colors animate via ; groups allow collective effects.

SMIL timing enables sequencing: ‘begin’ offsets, ‘dur’ durations, ‘repeatCount’ loops. Events trigger via ‘begin=”element.click”‘. Interactivity shines: JavaScript manipulates attributes for dynamic changes.

SVG excels in scalable graphics with paths, gradients, and masks but remains declarative, limiting real-time computations. Browser support is strong, though IE lags.

<svg width="400" height="200">
  <circle cx="50" cy="50" r="40" fill="red">
    <animate attributeName="cx" from="50" to="350" dur="2s" repeatCount="indefinite"/>
  </circle>
</svg>

This code animates a circle horizontally, illustrating SVG’s embeddability in HTML5.

Programmatic 2D Animations: Canvas for Frame-by-Frame Control

Canvas offers a bitmap context for JavaScript drawing. ‘requestAnimationFrame’ schedules redraws at 60fps, clearing and repainting each frame.

Basic shapes (rectangles, paths) fill or stroke; images draw via ‘drawImage’. For physics, libraries like Box2D simulate collisions, as in a bouncing ball demo.

Compositing modes (e.g., ‘source-over’) layer effects; shadows add depth. Text renders with fonts; patterns tile images.

Canvas suits games or simulations needing calculations per frame, like particle systems. However, it’s bitmap-based, losing scalability, and requires redrawing everything each frame, taxing performance for complex scenes.

const canvas = document.getElementById('myCanvas');
const ctx = canvas.getContext('2d');
function animate() {
  ctx.clearRect(0, 0, canvas.width, canvas.height);
  ctx.fillStyle = 'blue';
  ctx.fillRect(x, y, 50, 50); // Draw moving rectangle
  x += 1; // Update position
  requestAnimationFrame(animate);
}
animate();

This snippet moves a rectangle, demonstrating frame updates.

Diving into 3D: WebGL’s Programmatic Power with Shaders

WebGL, on Canvas’s ‘webgl’ context, leverages GPU via OpenGL ES. Setup involves shaders: vertex (positioning) and fragment (coloring) in GLSL.

A simple triangle requires vertex buffers, shader compilation, and drawing with ‘drawArrays’. Matrices handle transformations; perspective projection creates 3D illusions.

Textures map images; lighting (Lambert, Phong) computes via normals. Techniques like normal mapping simulate bumps; environment mapping fakes reflections using cube maps.

Libraries like three.js abstract complexities: ‘new THREE.Mesh’ creates objects with materials. Demos show textured, illuminated models without writing shaders.

WebGL enables high-performance 3D, ideal for visualizations or games, but demands graphics knowledge. Browser support grows, though mobile varies.

const gl = canvas.getContext('webgl');
const vertexShader = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(vertexShader, `
  attribute vec4 position;
  void main() {
    gl_Position = position;
  }
`);
gl.compileShader(vertexShader);
// Similar for fragment shader, then link program

This initializes a vertex shader, foundational for WebGL.

Choosing the Right Tool: Contexts and Implications for Web Development

Gorner compares: CSS3 for simple declarative effects; SVG for vector precision and interactivity; Canvas for 2D programmatic needs; WebGL for immersive 3D.

Mobile apps set expectations for fluid UIs; HTML5 meets this sans plugins. Prefixes persist but tools mitigate. Performance favors GPU-accelerated methods.

Workshops on AppSpot cover CSS3, Canvas with Box2D, and WebGL, enabling hands-on learning.

In summary, HTML5’s animations enhance intuitiveness, with choices suiting project scales and requirements.

Relevant Links and Hashtags

Links:

PostHeaderIcon [DevoxxFR2013] Devoxx and Parleys: Expanding the Family and Embracing HTML5

Lecturer

Stephan Janssen is a serial entrepreneur who founded the Belgian Java User Group (BeJUG) in 1996, JCS International in 1998, JavaPolis in 2001 (which evolved into Devoxx), and Parleys.com in 2006. With Java experience since 1995, he has developed real-world solutions in finance and manufacturing. Recognized as a BEA Technical Director and Java Champion, he has spoken at numerous conferences worldwide.

Abstract

Stephan Janssen’s address provides an overview of the Devoxx conference family’s growth and announces Parleys.com’s transition to HTML5. Highlighting synergies across editions and new initiatives like Devoxx for Kids, he demonstrates community expansion. The live demonstration of Parleys’ beta version emphasizes accessibility, free content, and user empowerment, signaling a shift toward inclusive, technology-driven knowledge sharing.

The Devoxx Family: Growth and Cross-Cultural Synergies

Janssen reflects on Devoxx’s evolution into a global “family,” fostering friendships and cultural exchanges. From Devoxx Belgium’s blue sweatshirts and volunteer-driven structure to the Paris JUG’s involvement in France, the model relies on steering and program committees plus helpers.

Expansion includes Devoxx UK, with its “Mind the Geek” t-shirts, drawing 500 attendees in London. Collectively, editions attract 5,500 “Devoxxians” annually, a testament to community strength without financial burden on organizers.

A heartfelt initiative is Devoxx for Kids, inspired by Janssen’s son Arthur. October sessions in Flemish and French sparked a “viral” spread to the Netherlands, UK, Toronto, and Norway. Even rebranded events like GCON for Kids advance youth engagement. Notably, 25% participants were girls, addressing gender gaps in IT by inspiring 10-14-year-olds toward engineering careers.

This interconnected network amplifies impact, blending cultures while maintaining local flavors.

Parleys’ HTML5 Evolution: Accessibility and Community Features

Janssen announces Parleys.com’s beta, ditching Flash for HTML5, enabling iPad viewing (phones pending). A key decision: all Devoxx France talks free, removing paywalls to maximize reach post-processing.

Live demo showcases features: anonymous browsing with slide scrubbing for previews; detailed views; related talks via MongoDB for speed. Social integration allows liking/disliking, with wristband likes from events projected online.

Logged-in users get free channels for uploading PDFs, editable metadata, and mashups with YouTube videos via drag-and-drop timelines. This empowers speakers and JUGs to enhance presentations without coding.

To sustain four full-time developers, tiers include Basic (free, unlimited PDFs/videos via YouTube hosting), Pro, and Enterprise. Two-week sprints ensure rapid iterations; feedback panels invite input.

Parleys’ shift democratizes content, leveraging HTML5 for broader, device-agnostic access.

Relevant Links and Hashtags

Links: