Archive for the ‘General’ Category
[DevoxxFR2012] Input/Output: 16 Years Later – Advancements in Java’s I/O Capabilities
Lecturer
Jean-Michel Doudoux has pursued a lifelong passion for software development and technological exploration, starting from his early experiences with a Commodore 64. His professional path includes extensive work in SSII settings and independent projects involving multiple programming languages. Embracing Java since its 1.0 release, Jean-Michel has become a prominent educator in the field, authoring two comprehensive tutorials distributed under the GNU FDL license. One focuses on Eclipse, spanning roughly 600 pages, while the other, which he continues to update, covers Java in over 100 chapters and 2400 pages. As co-founder of the Lorraine JUG and a member of YaJUG, he actively engages with the Java community through organization of events and sharing of resources. His website hosts these tutorials and related materials.
Abstract
Jean-Michel Doudoux provides an in-depth review of input/output (I/O) evolution in Java, from the initial java.io package in Java 1.0 to the sophisticated NIO.2 framework introduced in Java 7. He dissects the shortcomings of earlier APIs in handling files, asynchronous operations, and metadata, showcasing how NIO.2 introduces efficient, extensible solutions. With extensive code demonstrations and comparative evaluations, Doudoux covers path operations, attribute management, permissions, directory navigation, and event notifications. The analysis reveals methodological improvements for performance and cross-platform consistency, with significant ramifications for data-intensive applications, server-side processing, and modern software engineering practices.
Early Java I/O: Streams and Initial Constraints
Jean-Michel Doudoux commences by outlining the foundational I/O mechanisms in Java, rooted in the java.io package since version 1.0. This API centered on streams for byte or character data, offering basic functionality for reading and writing but suffering from synchronous blocking that hindered scalability in networked or multi-threaded scenarios. The File class served as the primary interface for filesystem interactions, yet it was limited to simple operations like existence checks, deletion, and renaming, without support for symbolic links or detailed metadata.
Doudoux highlights how paths were treated as mere strings, prone to errors from platform-specific separators—forward slashes on Unix-like systems versus backslashes on Windows. Creating directories required manual verification of parent existence, and attribute access like last modification time necessitated platform-dependent native code, compromising portability. These constraints often forced developers to resort to external libraries for routine tasks, such as recursive directory deletion or efficient copying.
The introduction of NIO in Java 1.4 marked a step forward with channels and buffers for non-blocking I/O, particularly beneficial for socket communications. However, Doudoux notes that filesystem capabilities remained underdeveloped; RandomAccessFile allowed position-based access, but asynchronous file operations were absent. This historical overview underscores the need for a more comprehensive API, setting the foundation for NIO.2’s contributions.
NIO.2’s Core Abstractions: Filesystems, Paths, and Providers
Doudoux proceeds to the heart of NIO.2, encapsulated in the java.nio.file package, which abstracts filesystems through the FileSystem interface and its implementations. This design allows uniform treatment of local disks, ZIP archives, or even custom virtual filesystems, greatly improving code reusability across environments.
Path objects, created via Paths.get(), represent locations independently of the underlying filesystem. Doudoux explains relativization—computing paths between locations—and resolution—combining paths—while normalization eliminates redundancies like “.” or “..”. For instance, resolving a relative path against an absolute one yields a complete location, mitigating common string concatenation pitfalls.
Path base = Paths.get("/projects/devoxx");
Path relative = Paths.get("slides/part3.pdf");
Path fullPath = base.resolve(relative); // /projects/devoxx/slides/part3.pdf
Path cleaned = Paths.get("/projects/./devoxx/../archive").normalize(); // /projects/archive
Filesystem providers extend this flexibility: the default handles local files, but NewFileSystem mounts alternatives like ZIPs. Doudoux codes an example:
Map<String, String> env = new HashMap<>();
env.put("create", "true"); // Create if absent
URI uri = URI.create("jar:file:/data/archive.zip");
FileSystem zipFs = FileSystems.newFileSystem(uri, env);
This enables treating archives as navigable directories, useful for bundled resources or logs. Custom providers could integrate remote storage like FTP or cloud services, expanding Java’s reach in distributed systems.
Managing File Attributes, Permissions, and Security
NIO.2 revolutionizes attribute access, Doudoux asserts, through Files methods and attribute views. BasicFileAttributes exposes universal properties like creation time, size, and directory status, while platform-specific views like PosixFileAttributes add owner and group details.
Reading attributes uses getAttribute() or readAttributes():
Path file = Paths.get("/logs/app.log");
BasicFileAttributes attrs = Files.readAttributes(file, BasicFileAttributes.class);
long size = attrs.size();
Instant lastModified = attrs.lastModifiedTime().toInstant();
Permissions leverage AclFileAttributeView for Windows ACLs or PosixFilePermissions for Unix-like systems:
Path secureFile = Paths.get("/config/secrets.properties");
PosixFileAttributeView posixView = Files.getFileAttributeView(secureFile, PosixFileAttributeView.class);
posixView.setPermissions(PosixFilePermissions.fromString("rw-------"));
posixView.setOwner(UserPrincipalLookupService.lookupPrincipalByName("admin"));
Doudoux stresses platform awareness: not all attributes are supported everywhere, requiring fallback strategies. This granularity enhances security in enterprise applications, allowing fine-tuned access control without external tools.
Efficient Directory Operations and Event Monitoring
Directory traversal in NIO.2 employs Files.walk() for streams or walkFileTree() with FileVisitor for customized walks. Doudoux details visitor callbacks—preVisitDirectory, visitFile, postVisitDirectory, visitFileFailed—enabling actions like filtering or error recovery.
For copying directories:
Path sourceDir = Paths.get("/old/project");
Path targetDir = Paths.get("/new/project");
Files.walkFileTree(sourceDir, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
Files.createDirectory(targetDir.resolve(sourceDir.relativize(dir)));
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Files.copy(file, targetDir.resolve(sourceDir.relativize(file)));
return FileVisitResult.CONTINUE;
}
});
This handles symlinks and errors gracefully. Monitoring uses WatchService: register paths for events (create, delete, modify), poll for keys, process events.
WatchService watcher = FileSystems.getDefault().newWatchService();
Path monitoredDir = Paths.get("/watched/folder");
monitoredDir.register(watcher, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_DELETE);
while (true) {
WatchKey key = watcher.take();
for (WatchEvent<?> event : key.pollEvents()) {
Path changed = (Path) event.context();
// React to changed
}
boolean valid = key.reset();
if (!valid) break;
}
Doudoux notes event granularity varies by OS, requiring application-level filtering.
Asynchronous I/O Channels: Non-Blocking for Scalability
NIO.2’s asynchronous channels—AsynchronousFileChannel, AsynchronousSocketChannel—facilitate non-blocking operations, Doudoux explains. Use futures for blocking waits or CompletionHandlers for callbacks.
AsynchronousFileChannel asyncChannel = AsynchronousFileChannel.open(path, StandardOpenOption.READ);
ByteBuffer buf = ByteBuffer.allocate(4096);
Future<Integer> readFuture = asyncChannel.read(buf, 0);
int bytesRead = readFuture.get(); // Blocks until complete
Handlers:
asyncChannel.read(buf, 0, null, new CompletionHandler<Integer, Void>() {
@Override
public void completed(Integer result, Void attachment) {
// Process buffer
}
@Override
public void failed(Throwable exc, Void attachment) {
// Handle error
}
});
Doudoux analyzes scalability: servers handle thousands of connections without thread blocking, ideal for high-throughput systems like web servers or data pipelines.
Broader Impacts on Java Ecosystems and Development Practices
Doudoux reflects on NIO.2’s transformative effects: it standardizes operations previously requiring hacks, promoting cleaner code. For portability, abstracted filesystems ease multi-platform development; for performance, asynchronous I/O reduces latency in I/O-bound apps.
In enterprises, this means efficient log monitoring or data migration. Doudoux acknowledges low-level aspects require care but praises extensibility for future integrations like cloud storage.
Overall, NIO.2 modernizes Java I/O, aligning it with contemporary demands for efficiency and flexibility.
Links:
[DevoxxFR2012] There Is No Good Business Model: Rethinking Domain Modeling for Service-Oriented Design and Implementation
Lecturer
Grégory Weinbach has cultivated more than twenty years of experience in software development, spanning a diverse spectrum of responsibilities that range from sophisticated tooling and code generation frameworks to agile domain modeling and the practical application of Domain Driven Design principles. His professional journey reflects a deliberate pursuit of polyvalence, enabling him to operate fluidly across the entire software development lifecycle—from gathering nuanced user requirements to implementing robust, low-level solutions. Grégory maintains a discerning and critical perspective on prevailing methodologies, whether they manifest as Agile practices, Model-Driven Architecture, Service-Oriented Architecture, or the contemporary Software Craftsmanship movement, always prioritizing the fundamental question of “why” before addressing the mechanics of “how.” He is a frequent speaker at various technical forums, including the Paris Java User Group and all five editions of the MDDay conference, and regularly conducts in-depth seminars for enterprise clients on pragmatic modeling techniques that balance theoretical rigor with real-world applicability.
Abstract
Grégory Weinbach delivers a provocative and intellectually rigorous examination of a widely held misconception in software design: the notion that a “good” domain model must faithfully mirror the intricacies of the underlying business reality. He argues persuasively that software systems do not replicate the business world in its entirety but rather operationalize specific, value-delivering services within constrained computational contexts. Through a series of meticulously constructed case studies, comparative analyses, and conceptual diagrams, Grégory demonstrates how attempts to create comprehensive, “truthful” business models inevitably lead to bloated, inflexible codebases that become increasingly difficult to maintain and evolve. In contrast, he advocates for a service-oriented modeling approach where domain models are deliberately scoped, context-bound artifacts designed to support concrete use cases and implementation requirements. The presentation delves deeply into the critical distinction between business models and domain models, the strategic use of bounded contexts as defined in Domain Driven Design, and practical techniques for aligning technical architectures with organizational service boundaries. The implications of this paradigm shift are profound, encompassing reduced developer cognitive load, enhanced system evolvability, accelerated delivery cycles, and the cultivation of sustainable software architectures that remain resilient in the face of changing business requirements.
The Fallacy of Universal Truth: Why Business Reality Cannot Be Fully Encapsulated in Code
Grégory Weinbach commences his discourse with a bold and counterintuitive assertion: the persistent belief that effective software modeling requires a direct, isomorphic mapping between code structures and real-world business concepts represents a fundamental and pervasive error in software engineering practice. He elucidates that while business models—typically expressed through process diagrams, organizational charts, and natural language descriptions—serve to communicate and analyze human activities within an enterprise, domain models in software exist for an entirely different purpose: to enable the reliable, efficient, and maintainable execution of specific computational tasks. Attempting to construct a single, monolithic model that captures the full complexity of a business domain inevitably results in an unwieldy artifact that attempts to reconcile inherently contradictory perspectives, leading to what Weinbach terms “model schizophrenia.” He illustrates this phenomenon through a detailed examination of a retail enterprise scenario, where a unified model encompassing inventory management, customer relationship management, financial accounting, and regulatory compliance creates a labyrinthine network of interdependent entities. A modification to inventory valuation rules, for instance, might inadvertently cascade through customer segmentation logic and tax calculation modules, introducing subtle bugs and requiring extensive regression testing across unrelated functional areas.
Bounded Contexts as Cognitive and Architectural Boundaries: The Domain Driven Design Solution
Building upon Eric Evans’ foundational concepts in Domain Driven Design, Weinbach introduces bounded contexts as the primary mechanism for resolving the contradictions inherent in universal modeling approaches. A bounded context defines a specific semantic boundary within which a particular model and its associated ubiquitous language hold true without ambiguity. He argues that each bounded context deserves its own dedicated model, even when multiple contexts reference conceptually similar entities. For example, the notion of a “customer” within a marketing analytics context—characterized by behavioral attributes, segmentation tags, and lifetime value calculations—bears little structural or behavioral resemblance to the “customer” entity in a legal compliance context, which must maintain immutable audit trails, contractual obligations, and regulatory identifiers. Weinbach presents a visual representation of these distinct contexts, showing how the marketing model might employ lightweight, denormalized structures optimized for analytical queries, while the compliance model enforces strict normalization, versioning, and cryptographic signing. This deliberate separation not only prevents the contamination of precise business rules but also enables independent evolution of each model in response to domain-specific changes, dramatically reducing the blast radius of modifications.
Service-Oriented Modeling: From Abstract Nouns to Deliverable Verbs
Weinbach pivots from theoretical critique to practical prescription by advocating a service-oriented lens for domain modeling, where the primary organizing principle is not the static structure of business entities but the dynamic delivery of specific, value-adding services. He contends that traditional approaches often fall into the trap of “noun-centric” modeling, where developers attempt to create comprehensive representations of business objects loaded with every conceivable attribute and behavior, resulting in god classes that violate the single responsibility principle and become impossible to test or modify. Instead, he proposes that models should be constructed around concrete service verbs—”process payment,” “generate invoice,” “validate shipment”—with each model containing only the minimal set of concepts required to fulfill that service’s contract. Through a logistics case study, Weinbach demonstrates how modeling the “track shipment” service yields a streamlined aggregate consisting of a shipment identifier, a sequence of timestamped status events, and a current location, purposefully omitting unrelated concerns such as inventory levels or billing details. This focused approach not only produces cleaner, more maintainable code but also naturally aligns technical boundaries with organizational responsibilities, facilitating clearer communication between development teams and business stakeholders.
The Human Factor: Reducing Cognitive Load and Enhancing Team Autonomy
One of the most compelling arguments Weinbach advances concerns the human dimension of software development. Universal models, by their very nature, require developers to maintain a vast mental map of interrelationships and invariants across the entire system, dramatically increasing cognitive load and the likelihood of errors. Service-oriented, context-bound models, conversely, allow developers to focus their attention on a well-defined subset of the domain, mastering a smaller, more coherent set of concepts and rules. This reduction in cognitive complexity translates directly into improved productivity, fewer defects, and greater job satisfaction. Moreover, when technical boundaries mirror organizational boundaries—such as when the team responsible for order fulfillment owns the order processing context—they gain true autonomy to evolve their domain model in response to business needs without coordinating with unrelated teams, accelerating delivery cycles and fostering a sense of ownership and accountability.
Practical Implementation Strategies: From Analysis to Code
Weinbach concludes his presentation with a comprehensive set of practical guidelines for implementing service-oriented modeling in real-world projects. He recommends beginning with event storming workshops that identify key business events and the services that produce or consume them, rather than starting with entity relationship diagrams. From these events, teams can derive bounded contexts and their associated models, using techniques such as context mapping to document integration patterns between contexts. He demonstrates code examples showing how anti-corruption layers translate between context-specific models when integration is required, preserving the integrity of each bounded context while enabling necessary data flow. Finally, Weinbach addresses the challenging task of communicating these principles to non-technical stakeholders, who may initially resist the idea of “duplicating” data across models. He explains that while information duplication is indeed undesirable, data duplication across different representational contexts is not only acceptable but necessary when those contexts serve fundamentally different purposes.
Links:
(long tweet) How to make ChromeOS work in VirtualBox without Wifi?
Case
How to make ChromeOS work in VirtualBox without Wifi, ie on an ethernet/wired local network, or even offline?
Quick Fix
Shutdown the VM > Select it > Settings > Network > Advanced > Adapter Type > select “Paravirtualized Network (virtio-net)”
(long tweet) Virtual Box / PAE processor
Case
On booting ChromeOS Vanilla within Virtual Box, I got the following error:
[java]This kernel requires the following features not present on the CPU: pae
Unable to boot – please use a kernel appropriate for your CPU.[/java]
(Actually, the problem occured with ChromeOS but may have appened with another system)
Quick Fix
In Virtual Box, select the VM > Settings > Processor > check “Enable PAE/NX”.
[DevoxxBE2012] 7 Things: How to Make Good Teams Great
Sven Peters, an Atlassian ambassador with over a decade in Java EE development and team leadership, shared strategies for elevating competent teams to exceptional levels. Sven, passionate about clean code and developer motivation, drew from Atlassian’s experiences to outline seven practices fostering innovation and productivity while sustaining focus on quality products.
He opened by challenging assumptions about agile methodologies, observing that some self-proclaimed agile teams underperform, while certain traditional ones excel. Sven emphasized that true greatness transcends labels, requiring deliberate actions to boost morale and efficiency.
Atlassian, known for tools like Jira and Confluence, exemplifies these principles through an open culture that values feedback and experimentation. Sven warned that while inspiring, these methods must adapt to individual contexts, with readiness to iterate based on outcomes.
Enhancing Focus and Flow
Sven advocated protecting developers’ concentration, introducing “do not disturb” periods where interruptions halt, allowing deep work. At Atlassian, engineers signal availability with signs, reducing context switches that hinder productivity.
He stressed feeding intellectual curiosity via learning opportunities, such as internal talks or external conferences. These sessions, often during lunch, cover diverse topics, sparking ideas and cross-team collaboration.
Appreciating efforts, even minor ones, builds positivity. Sven described Atlassian’s kudos system, where peers publicly recognize contributions, reinforcing a supportive environment.
Automating Insights and User Empathy
To streamline oversight, Sven recommended automated reports aggregating metrics like code commits and bug fixes. These dashboards provide quick overviews without manual effort, freeing time for creative tasks.
“Dogfooding”—using one’s own products internally—bridges gaps between creators and users. At Atlassian, this uncovers issues early, fostering empathy and better designs. Sven shared how it led to improvements in their tools.
Sparking Innovation Through Dedicated Time
Special days, like “ShipIt” events, tackle backlog items in focused bursts. Atlassian’s 24-hour hackathons encourage wild ideas, with voting and implementation for winners, injecting fun and progress.
Experimentation time, such as 20% personal projects, drives breakthroughs. Sven recounted how this birthed features like Jira’s rapid boards, enhancing products while empowering staff.
He rated these practices’ feasibility and impact, urging measured trials to gauge effectiveness.
Adapting and Measuring Success
Sven concluded by encouraging experimentation, acknowledging failures as learning opportunities. Atlassian’s disbanded innovation team taught that distributed creativity works better.
He advised time-boxing initiatives, tracking results, and customizing approaches. Being distinctive in practices attracts and retains talent in a competitive field.
Sven’s insights, rooted in real-world application, offer a blueprint for transforming solid teams into outstanding ones through intentional, adaptive strategies.
Links:
[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:
[DevoxxFR2012] Java on Amazon Web Services: Building Scalable, Resilient Applications in the Cloud
Lecturer
Carlos Conde operates as a Solutions Architect within Amazon Web Services’ European team, where he partners with enterprises to design, migrate, and optimize Java applications on the AWS platform. His technical journey began over a decade ago when he founded IWorks, a company focused on Java web development atop legacy mainframe systems, followed by co-founding Newaxe, which delivered a Java-based ERP monitoring and management platform. After years as an independent consultant helping Fortune 500 companies modernize their stacks, Carlos joined AWS to bring cloud-native principles to the broader Java community. His expertise spans the full application lifecycle—from initial architecture through production operations—with a particular emphasis on cost optimization, high availability, and security.
Abstract
Carlos Conde provides an exhaustive guide to developing, deploying, and operating Java applications on Amazon Web Services, demonstrating how the platform’s breadth of services enables developers to build systems that are simultaneously scalable, resilient, and cost-effective. He introduces AWS Elastic Beanstalk as a fully managed Platform as a Service solution that abstracts infrastructure complexity, the AWS SDK for Java for programmatic service access, and the AWS Toolkit for Eclipse for seamless IDE integration. Through detailed live demonstrations and real-world case studies from companies like Viadeo and Netflix, Conde explores deployment strategies, database patterns, content delivery, monitoring, and disaster recovery. The presentation addresses hybrid cloud scenarios, data sovereignty requirements under European regulations, and advanced cost management techniques, concluding with a vision of serverless Java and containerized workloads that redefine operational excellence.
The AWS Java Ecosystem: Tools for Every Stage of Development
Carlos Conde opens by mapping the AWS service landscape to the Java developer’s workflow. At the foundation lies Amazon EC2, offering virtual servers with pre-built Java AMIs (Amazon Machine Images) that include OpenJDK, Tomcat, and Spring Boot. For developers seeking higher abstraction, AWS Elastic Beanstalk provides a PaaS experience where applications are deployed via simple commands:
eb init -p java-8 my-java-app
eb create production-env --instance_type t3.medium
eb deploy
Behind the scenes, Beanstalk provisions EC2 instances, Elastic Load Balancers, Auto Scaling groups, and CloudWatch alarms, while allowing full customization through .ebextensions configuration files. Conde demonstrates deploying a Spring Boot application that automatically scales from 2 to 10 instances based on CPU utilization, with zero-downtime blue/green deployments.
The AWS SDK for Java serves as the programmatic bridge to over 200 AWS services. Conde writes a service that stores user profiles in Amazon DynamoDB:
AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
.withRegion(Regions.EU_WEST_3)
.build();
Map<String, AttributeValue> item = new HashMap<>();
item.put("userId", AttributeValue.builder().s(userId).build());
item.put("email", AttributeValue.builder().s(email).build());
item.put("createdAt", AttributeValue.builder().n(Long.toString(timestamp)).build());
PutItemRequest request = PutItemRequest.builder()
.tableName("Users")
.item(item)
.build();
client.putItem(request);
DynamoDB’s single-digit millisecond latency and automatic scaling make it ideal for high-throughput workloads. For relational data, Amazon RDS offers managed PostgreSQL, MySQL, or Oracle with automated backups, patching, and multi-AZ replication.
Content Delivery and Global Reach
For static assets, Conde integrates Amazon S3 with CloudFront:
AmazonS3 s3 = AmazonS3ClientBuilder.standard().build();
s3.putObject(PutObjectRequest.builder()
.bucket("my-app-assets")
.key("css/style.css")
.acl(ObjectCannedACL.PublicRead)
.build(), RequestBody.fromFile(Paths.get("style.css")));
CloudFront’s 200+ edge locations cache content close to users, reducing latency from 180ms to 30ms for European customers. He demonstrates invalidating cache after deployments using the AWS CLI.
Cost Optimization Strategies
Conde presents a multi-layered approach to cost control. Reserved Instances provide up to 75% savings for predictable workloads, while Savings Plans offer flexibility across EC2, Lambda, and Fargate. For batch processing, Spot Instances deliver 90% discounts:
RunInstancesRequest request = RunInstancesRequest.builder()
.instanceMarketOptions(InstanceMarketOptionsRequest.builder()
.marketType(MarketType.SPOT)
.spotOptions(SpotInstanceRequest.builder()
.spotPrice("0.10")
.instanceInterruptionBehavior(InstanceInterruptionBehavior.TERMINATE)
.build())
.build())
.build();
He uses AWS Cost Explorer to visualize spending and set budget alerts.
High Availability and Disaster Recovery
Conde designs a multi-AZ architecture with RDS read replicas, ElastiCache for Redis caching, and S3 cross-region replication. He demonstrates failover using Route 53 health checks that automatically reroute traffic if a region fails.
Security and Compliance
Security is baked into every layer. AWS Identity and Access Management (IAM) enforces least-privilege access, while AWS KMS manages encryption keys. Conde enables S3 server-side encryption and RDS TDE (Transparent Data Encryption) with a single click.
Hybrid and Sovereign Cloud Deployments
For European data residency, Conde deploys entirely within the Paris region (eu-west-3). For hybrid scenarios, AWS Direct Connect establishes dedicated network connections to on-premises data centers, and AWS Outposts brings AWS services into private facilities.
Monitoring, Logging, and Observability
Amazon CloudWatch collects metrics, logs, and events. Conde instruments a Spring Boot application with Micrometer:
@Timed(value = "order.processing.time", description = "Time taken to process order")
public Order processOrder(OrderRequest request) {
// Business logic
}
AWS X-Ray traces requests across services, identifying latency bottlenecks.
Real-World Case Studies
Conde shares Viadeo’s migration of their social platform to AWS, achieving 99.99% availability and reducing infrastructure costs by 60%. Netflix’s global streaming architecture leverages AWS for transcoding, personalization, and content delivery at petabyte scale.
The Future of Java on AWS
Conde previews AWS Lambda for serverless Java, AWS Fargate for containerized workloads without server management, and AWS Graviton2 processors offering 40% better price-performance for Java applications.
Implications for Java Enterprises
Carlos Conde concludes that AWS transforms Java development from infrastructure-constrained to innovation-focused. By leveraging managed services, developers build faster, operate more reliably, and scale globally—all while maintaining strict control over costs and compliance.
Links:
(long tweet) A story of return in try/catch/finally
A short reminder: in a try/catch/finally section, the block in the finally is always executed. “Always” means “even if a return statement is reached in the try or catch“.
A short piece of code shows more than a long speech. The following JUnit test ends with no error:
[java]package com.stepinfo.poc.cartography;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
/**
* Created with IntelliJ IDEA 12 "Leda" CE
* User: Jonathan LALOU
* Date: 08/Apr/13
* Time: 22:41
*/
public class TestTryCatchFinally {
public static final String TRY = "try";
public static final String CATCH = "catch";
public static final String FINALLY = "finally";
private String tryVersusFinally() {
try {
return TRY;
} catch (Exception e) {
return CATCH;
} finally {
return FINALLY;
}
}
private String catchVersusFinally() {
try {
throw new RuntimeException();
} catch (Exception e) {
return CATCH;
} finally {
return FINALLY;
}
}
@Test
public void testTryFinally() {
assertNotSame(TRY, tryVersusFinally());
assertEquals(FINALLY, tryVersusFinally());
}
@Test
public void testCatchFinally() {
assertNotSame(CATCH, tryVersusFinally());
assertEquals(FINALLY, catchVersusFinally());
}
}
[/java]
(long tweet) java.lang.SecurityException: Prohibited package name
Case
Here is a case of stupid error. I started up a new project in IntelliJ IDEA, laying on a Maven archetype. On launching the first unit test, I got the following error:
[java]Cannot instantiate test(s): java.lang.SecurityException: Prohibited package name: java.lalou.jonathan.multiposts[/java]
Quick fix
As you may have noticed, the package name was prefixed with java.… which is prohibited by the JDK. An immediate fix is to restore a package name not starting with java..
The code in the JDK is explicit: the exception with such a message is raised in a unique occasion:
[java] if ((name != null) && name.startsWith("java.")) {
throw new SecurityException
("Prohibited package name: " +
name.substring(0, name.lastIndexOf(‘.’)));
}
[/java]
Retour sur Devoxx FR 2013
J’ai eu la chance d’assister a la derniere journee de DevoxxFR a Paris, le vendredi 29/03/2013, pour le compte de mon employeur StepInfo, sponsor de l’evenement. Voici quelques impressions en vrac
General
- C’est bien organise, il y a du monde, et excepte au moment du depart au niveau des vestiaires, il n’y a pas eu de gros souci de logistique.
- Les entreprises sponsors ont joue le jeu 😉
- Que ce soit au niveau des stands ou des conferences, la domination des Mac est ecrasante! Google a reussi a mettre en valeur ses ChromeBooks, mais j’ai vu peu de Windows et encore moins de Linux.
- J’ai pu assister a 4 conferences, toutes interessantes, mais d’un niveau heterogene, je reviens dessus plus en detail ci-dessous.
IDE Java : astuces de productivité pour le quotidien
La conference est animee par Xavier Hanin (@xavierhanin). Il y presente les trois IDE phares du monde Java: NetBeans, Eclipse et IntelliJ IDEA.
Maitrisant plutot bien IDEA, je n’ai pas appris de choses fondamentales sur mon IDE, si ce n’est le raccourci Ctrl+Shift+A pour afficher les intentions. J’ai connu NetBeans a ses debuts (Forte puis Sun ONE), mais j’en ai totalement perdu la maitrise depuis des annees. Quant a Eclipse, il m’arrive de le lancer quelques fois par an pour des problematiques clients specifiques, mais je suis contraint d’avoir recours a la souris en quasi-permanence ; sous IDEA c’est tres rare.
Un “sondage” assez grossier des personnes dans la salle a donne des resultats interessants: ~15% des developpeurs presents utilisent NetBeans, ~25% IDEA et ~90/95% Eclipse.
Quick Start avec le Cloud Google
La conference est animee par Didier Girard de SFEIR et Alexis Moussine-Pouchkine de Google France. Les principaux outils de Google pour le cloud sont presentes, en prenant pour hypothese de creer une startup: une solution “a l’ancienne”, avec serveurs d’applications, gestion materielle etc. est avancee, avant de ceder la place a une solution entierement sur le cloud de Google.
En un mot: c’est tres convaincant.
Je regrette que le sujet n’ait pas ete elargi vers des solutions cloud alternatives, comme celle d’Amazon.
- Didier Girard:
- Sur twitter: @DidierGirard
- Sur Google+: +Didier
- Alexis Moussine-Pouchkine:
- Blog: http://alexismp.wordpress.com/
- Twitter: @alexismp
- Google+: +Alexis
The Spring Update: Looking at Spring 3.1, 3.2, and 4.0
La presentation est menee par Josh Long de SpringSource. On se rend compte tres rapidement que ne serait-ce que pour la qualite du show, nous les Francais (voire les Latins) nous sommes largement en dessous de la qualite des Anglo-Saxons.
Josh enonce ses concepts, donne des exemples, met l’eau a la bouche. Au bout de 50′ de conference, je n’ai plus qu’une envie: retourner coder avec les dernieres versions de Spring!
Parmi toutes les nouveautes, j’en retiens deux:
- l’
AnnotationConfigApplicationContext, qui m’evitera de taper d’ecrire un bloc comme:[xml] <context:component-scan annotation-config="true" base-package="lalou.jonathan.beans"/>[/xml] - l’integration future des websockets d’HTML5 pour obeir a la norme JEE7 d’ici la fin de l’annee.
Ce dernier point m’interesse particulierement, en raison d’un projet sur lequel je travaille actuellement, et dont nombre de problemes seraient resolus par les websockets de JEE7. Theoriquement, et potentiellement, d’ici la fin de l’annee 2013, nous pourrions integrer une brique “Spring JEE7” avec websocket au sein d’un WebSphere 8 (donc non JEE7-compliant), au lieu d’etre dependant dans la prochaine release du serveur d’applications d’IBM.
Josh:
- sur twitter: @starbuxman
- sur son blog: http://joshlong.com/
- Google+: +Josh
Entre HPC et big data: un case study sur la simulation du risque de contrepartie
C’est la conference dont j’ai vu le moins le rapport avec Devoxx, mais ayant passe 7 ans dans la finance de marche j’y ai trouve mon interet. En passant, j’y ai vu le seul PC sous Windows de toutes les conferences :-D.
Le theme de cette conference est: comment deporter une partie du calcul intensif de Monte-Carlo du CPU vers les GPU? Ces derniers ont une taille et une structure de memoire radicalement differente de celles des CPU (CPU+RAM pour etre plus precis). Les GPU permettent d’effectuer des masses de calcul en un temps bien plus faible (jusqu’a 99% de gain) qu’en architecture classique, moyennant une reecriture du code C en un autre langage adapte, par exemple OpenCL.
Les deux speakers, de Murex, sont Adrien Tay Pamart (visiblement pas tres a l’aise en mode geek) et Jonathan Lellouche pour la partie technique.
Durant les questions, l’existence de ponts Java vers OpenCL, comme JavaCL est evoquee. Il est dommage de ne pas avoir plus de temps pour creuser ce theme.
5 ans et 500 releases en 50 minutes !
La presentation est dirigee par Freddy Mallet et Olivier Gaudin de Sonar.
La demonstration est rudement bien faite. Les dirigeant de SonarSource retracent, dans un ordre plus ou moins chronologique, les problemes, ou les impediments a-t-on envie de dire, rencontres en 5 ans sur Sonar.
Quelques themes forts: le context switching est une plaie, on ne gere pas une entreprise commerciale avec des clients comme un simple projet open source, etc.
- Freddy:
- Sur twitter: @FreddyMallet
- Olivier:
- Sur twitter: @gaudol
En guise de conclusion
Devoxx a repondu aux attentes que j’avais en y entrant:
- une journee de formation intensive et motivante
- revoir des “anciennes tetes”
- echanger des cartes de visite
Qu’il me soit donc permis ici de remercier StepInfo pour m’avoir permis d’acceder a cette journee, ainsi que les organisateurs de Devoxx pour le travail qu’il ont accompli.
Vivement DevoxxFR 2014!