Recent Posts
Archives

Posts Tagged ‘EnterpriseJava’

PostHeaderIcon [DevoxxBE2012] Real World Java EE

Adam Bien, a renowned Java consultant, author, and Java Champion with decades of experience in enterprise applications, delivered an impromptu yet insightful session on practical Java EE usage. Adam, known for books like “Real World Java EE Patterns,” shared real-world insights from his freelance projects, emphasizing simplicity and effectiveness over hype.

He started by recounting his journey since 1995, favoring Java EE for its robustness in production. Adam advocated thin WAR deployments, bundling everything into a single archive for easy management, contrasting with complex EAR structures.

Discussing boundaries, Adam promoted domain-driven design, where entities form the core, with services as facades. He cautioned against unnecessary abstractions, like excessive DAOs, favoring direct JPA usage.

Adam highlighted CDI’s power for dependency injection, reducing boilerplate. He demonstrated boundary-control-entity patterns, where boundaries handle transactions, controls manage logic, and entities persist data.

Deployment Strategies and Simplicity

Adam stressed deploying as WARs to containers like GlassFish, avoiding heavy setups. He shared experiences with microservices avant la lettre, using REST for inter-service communication.

He critiqued over-engineering, like misusing ESBs for simple integrations, preferring lightweight approaches.

Testing and Quality Assurance

Adam advocated comprehensive testing: unit with JUnit, integration with Arquillian, and UI with Selenium/Graphene. He demonstrated embedding containers for realistic tests.

He emphasized boundary testing, simulating real scenarios without mocks where possible.

Performance and Scalability

Discussing optimization, Adam noted Java EE’s built-in clustering, but advised measuring first. He shared cases where simple configurations sufficed, avoiding premature scaling.

Community and Best Practices

Adam encouraged open-source contributions, sharing his GitHub projects. He addressed common pitfalls, like session misuse, advocating stateless designs.

In Q&A, he discussed tools like Jenkins for CI and IDEs like IntelliJ.

Adam’s talk reinforced Java EE’s viability for real-world applications through pragmatic, lean practices.

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: