With its ninth version, the Java platform has shifted gear and introduced biyearly releases. This was followed by a license change where Oracle, the steward of Java, now publishes a commercial and a non-commercial release of the Java virtual machine while other vendors took more space to promote their alternative builds of the OpenJDK. And in another flood of news, the Java EE specification was terminated and resolved into the Jakarta EE namespace.
A lot has been happening in the traditionally conservative Java ecosystem, to say the least, and many users are wondering if they still can rely on the platform. This talk gives an overview of the Java ecosystem, summarizes the changes that have been, that to expect and why the evolution of the platform is good news to the community.
With its ninth version, the Java platform has shifted gear and introduced biyearly releases. This was followed by a license change where Oracle, the steward of Java, now publishes a commercial and a non-commercial release of the Java virtual machine while other vendors took more space to promote their alternative builds of the OpenJDK. And in another flood of news, the Java EE specification was terminated and resolved into the Jakarta EE namespace.
A lot has been happening in the traditionally conservative Java ecosystem, to say the least, and many users are wondering if they still can rely on the platform. This talk gives an overview of the Java ecosystem, summarizes the changes that have been, that to expect and why the evolution of the platform is good news to the community.
At first glance, Java byte code can appear to be some low level magic that is both hard to understand and effectively irrelevant to application developers. However, neither is true. With only little practice, Java byte code becomes easy to read and can give true insights into the functioning of a Java program. In this talk, we will cast light on compiled Java code and its interplay with the Java virtual machine. In the process, we will look into the evolution of byte code over the recent major releases with features such as dynamic method invocation which is the basis to Java 8 lambda expressions. Finally, we will learn about tools for the run time generation of Java classes and how these tools are used to build modern frameworks and libraries. Among those tools, I present Byte Buddy, an open source tool of my own efforts and an attempt to considerably simplify run time code generation in Java.
Making Java more dynamic: runtime code generation for the JVMRafael Winterhalter
While Java’s strict type system is a great help for avoiding programming errors, it also takes away some of the flexibility that developers appreciate when using dynamic languages. By using runtime code generation, it is possible to bring some of this flexibility back to the Java virtual machine. For this reason, runtime code generation is widely used by many state-of-the-art Java frameworks for implementing POJO-centric APIs but it also opens the door to assembling more modular applications. This presentation offers an introduction to the complex of runtime code generation and its use on the Java platform. Furthermore, it discusses the up- and downsides of several code generation libraries such as ASM, Javassist, cglib and Byte Buddy.
While most bugs reveal their cause within their stack trace, Java’s OutOfMemoryError is less talkative and therefore regarded as being difficult to debug by a majority of developers. With the right techniques and tools, memory leaks in Java programs can however be tackled like any other programming error. This talks discusses how a JVM stores data, categorizes different types of memory leaks that can occur in a Java program and presents techniques for fixing such errors. Furthermore, we will have a closer look at lambda expressions and their considerable potential of introducing memory leaks when they are used incautiously.
Java agents and their instrumentation API offer developers the most powerful toolset to interact with a Java application. Using this API, it becomes possible to alter the code of running applications, for example to add monitoring or to inject security checks as it is done by many enterprise products for the Java ecosystem.
In this session, developers will learn how to program Java agents of their own that make use of the instrumentation API. Doing so, developers learn how the majority of tooling for the JVM is implemented and will learn about Byte Buddy, a high level code generation library that does not require any knowledge of Java byte code that is normally required for writing agents. In the process, developers will see how Java classes can be used as templates for implementing highly performant code changes that avoid the boilerplate of alternative solutions such as AspectJ or Javassist while still performing better than agents implemented in low-level libraries such as ASM.
At first glance, writing concurrent programs in Java seems like a straight-forward task. But the devil is in the detail. Fortunately, these details are strictly regulated by the Java memory model which, roughly speaking, decides what values a program can observe for a field at any given time. Without respecting the memory model, a Java program might behave erratic and yield bugs that only occure on some hardware platforms. This presentation summarizes the guarantees that are given by Java's memory model and teaches how to properly use volatile and final fields or synchronized code blocks. Instead of discussing the model in terms of memory model formalisms, this presentation builds on easy-to follow Java code examples.
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...Christopher Frohoff
Object deserialization is an established but poorly understood attack vector in applications that is disturbingly prevalent across many languages, platforms, formats, and libraries.
In January 2015 at AppSec California, Chris Frohoff and Gabe Lawrence gave a talk on this topic, covering deserialization vulnerabilities across platforms, the many forms they take, and places they can be found. It covered, among other things, somewhat novel techniques using classes in commonly used libraries for attacking Java serialization that were subsequently released in the form of the ysoserial tool. Few people noticed until late 2015, when other researchers used these techniques/tools to exploit well known products such as Bamboo, WebLogic, WebSphere, ApacheMQ, and Jenkins, and then services such as PayPal. Since then, the topic has gotten some long-overdue attention and great work is being done by many to improve our understanding and developer awareness on the subject.
This talk will review the details of Java deserialization exploit techniques and mitigations, as well as report on some of the recent (and future) activity in this area.
http://www.meetup.com/Open-Web-Application-Security-Project-San-Diego-OWASP-SD/events/226242635/
micro(-service) components. While this approach to building software - if done correctly - can improve a system's maintainability and scalability, distributed applications also introduce challanges for operations. Where monolithic applications typically offered direct access to extensive monitoring dashbords, such easy overview is no longer available when multitude services are loosly connected over a network. But how to keep track of a system of such dynamic state?
Distributed tracing is a method of connecting interaction of different services on a network. Collecting and processing such tracing information again allows for the observation of a distributed system in its entirety. This talk shares the presenter's insights gained by working on the JVM-support of distributed tracing for the APM tool Instana. Doing so, it introduces the landscape of distributed tracing on the JVM, discussing popular approaches such as Dapper, Zipkin or Brave/OpenTracing. In the process, it is discussed how byte code instrumentation can be used to capture systems without requiring a user to set up the software under observation. The presentation finishes with a discussion of typical problems of distributed tracing solutions and carefully examines the performance penalties APM tools entail.
In this cheat sheet, you can find object oriented programming concept's fundamentals very easily. Some topics has very details explanations that could be very helpful those who is in entry level in java mostly object oriented world.
Writing software for a virtual machine enables developers to forget about machine code assembly, interrupts, and processor caches. This makes Java a convenient language, but all too many developers see the JVM as a black box and are often unsure of how to optimize their code for performance. This unfortunately adds credence to the myth that Java is always outperformed by native languages. This session takes a peek at the inner workings of Oracle’s HotSpot virtual machine, its just-in-time compiler, and the interplay with a computer’s hardware. From this, you will understand the more common optimizations a virtual machine applies, to be better equipped to improve and reason about a Java program’s performance and how to correctly measure runtime!
Understanding bytecode and what bytecode is likely to be generated by a Java compiler helps the Java programmer in the same way that knowledge of assembler helps the C or C++ programmer. Java bytecode is the form of instructions that Java virtual machine executes. This knowledge is crucial when debugging and doing performance and memory usage tuning. The presenter will share his knowledge on what bytecode means for your platform and how to create compiler while using some awesome tools.
Concurrent Programming in Java provides a brief overview of the following topics:
• Java language support for concurrency
• Concurrency utilities (java.util.concurrent package)
• Java collections for multithreading (java.util package)
• Parallel streams in Java 8.
Try out the examples. Source code here: https://github.com/CodeOpsTech/ConcurrentJava
At first glance, Java byte code can appear to be some low level magic that is both hard to understand and effectively irrelevant to application developers. However, neither is true. With only little practice, Java byte code becomes easy to read and can give true insights into the functioning of a Java program. In this talk, we will cast light on compiled Java code and its interplay with the Java virtual machine. In the process, we will look into the evolution of byte code over the recent major releases with features such as dynamic method invocation which is the basis to Java 8 lambda expressions. Finally, we will learn about tools for the run time generation of Java classes and how these tools are used to build modern frameworks and libraries. Among those tools, I present Byte Buddy, an open source tool of my own efforts and an attempt to considerably simplify run time code generation in Java.
Making Java more dynamic: runtime code generation for the JVMRafael Winterhalter
While Java’s strict type system is a great help for avoiding programming errors, it also takes away some of the flexibility that developers appreciate when using dynamic languages. By using runtime code generation, it is possible to bring some of this flexibility back to the Java virtual machine. For this reason, runtime code generation is widely used by many state-of-the-art Java frameworks for implementing POJO-centric APIs but it also opens the door to assembling more modular applications. This presentation offers an introduction to the complex of runtime code generation and its use on the Java platform. Furthermore, it discusses the up- and downsides of several code generation libraries such as ASM, Javassist, cglib and Byte Buddy.
While most bugs reveal their cause within their stack trace, Java’s OutOfMemoryError is less talkative and therefore regarded as being difficult to debug by a majority of developers. With the right techniques and tools, memory leaks in Java programs can however be tackled like any other programming error. This talks discusses how a JVM stores data, categorizes different types of memory leaks that can occur in a Java program and presents techniques for fixing such errors. Furthermore, we will have a closer look at lambda expressions and their considerable potential of introducing memory leaks when they are used incautiously.
Java agents and their instrumentation API offer developers the most powerful toolset to interact with a Java application. Using this API, it becomes possible to alter the code of running applications, for example to add monitoring or to inject security checks as it is done by many enterprise products for the Java ecosystem.
In this session, developers will learn how to program Java agents of their own that make use of the instrumentation API. Doing so, developers learn how the majority of tooling for the JVM is implemented and will learn about Byte Buddy, a high level code generation library that does not require any knowledge of Java byte code that is normally required for writing agents. In the process, developers will see how Java classes can be used as templates for implementing highly performant code changes that avoid the boilerplate of alternative solutions such as AspectJ or Javassist while still performing better than agents implemented in low-level libraries such as ASM.
At first glance, writing concurrent programs in Java seems like a straight-forward task. But the devil is in the detail. Fortunately, these details are strictly regulated by the Java memory model which, roughly speaking, decides what values a program can observe for a field at any given time. Without respecting the memory model, a Java program might behave erratic and yield bugs that only occure on some hardware platforms. This presentation summarizes the guarantees that are given by Java's memory model and teaches how to properly use volatile and final fields or synchronized code blocks. Instead of discussing the model in terms of memory model formalisms, this presentation builds on easy-to follow Java code examples.
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...Christopher Frohoff
Object deserialization is an established but poorly understood attack vector in applications that is disturbingly prevalent across many languages, platforms, formats, and libraries.
In January 2015 at AppSec California, Chris Frohoff and Gabe Lawrence gave a talk on this topic, covering deserialization vulnerabilities across platforms, the many forms they take, and places they can be found. It covered, among other things, somewhat novel techniques using classes in commonly used libraries for attacking Java serialization that were subsequently released in the form of the ysoserial tool. Few people noticed until late 2015, when other researchers used these techniques/tools to exploit well known products such as Bamboo, WebLogic, WebSphere, ApacheMQ, and Jenkins, and then services such as PayPal. Since then, the topic has gotten some long-overdue attention and great work is being done by many to improve our understanding and developer awareness on the subject.
This talk will review the details of Java deserialization exploit techniques and mitigations, as well as report on some of the recent (and future) activity in this area.
http://www.meetup.com/Open-Web-Application-Security-Project-San-Diego-OWASP-SD/events/226242635/
micro(-service) components. While this approach to building software - if done correctly - can improve a system's maintainability and scalability, distributed applications also introduce challanges for operations. Where monolithic applications typically offered direct access to extensive monitoring dashbords, such easy overview is no longer available when multitude services are loosly connected over a network. But how to keep track of a system of such dynamic state?
Distributed tracing is a method of connecting interaction of different services on a network. Collecting and processing such tracing information again allows for the observation of a distributed system in its entirety. This talk shares the presenter's insights gained by working on the JVM-support of distributed tracing for the APM tool Instana. Doing so, it introduces the landscape of distributed tracing on the JVM, discussing popular approaches such as Dapper, Zipkin or Brave/OpenTracing. In the process, it is discussed how byte code instrumentation can be used to capture systems without requiring a user to set up the software under observation. The presentation finishes with a discussion of typical problems of distributed tracing solutions and carefully examines the performance penalties APM tools entail.
In this cheat sheet, you can find object oriented programming concept's fundamentals very easily. Some topics has very details explanations that could be very helpful those who is in entry level in java mostly object oriented world.
Writing software for a virtual machine enables developers to forget about machine code assembly, interrupts, and processor caches. This makes Java a convenient language, but all too many developers see the JVM as a black box and are often unsure of how to optimize their code for performance. This unfortunately adds credence to the myth that Java is always outperformed by native languages. This session takes a peek at the inner workings of Oracle’s HotSpot virtual machine, its just-in-time compiler, and the interplay with a computer’s hardware. From this, you will understand the more common optimizations a virtual machine applies, to be better equipped to improve and reason about a Java program’s performance and how to correctly measure runtime!
Understanding bytecode and what bytecode is likely to be generated by a Java compiler helps the Java programmer in the same way that knowledge of assembler helps the C or C++ programmer. Java bytecode is the form of instructions that Java virtual machine executes. This knowledge is crucial when debugging and doing performance and memory usage tuning. The presenter will share his knowledge on what bytecode means for your platform and how to create compiler while using some awesome tools.
Concurrent Programming in Java provides a brief overview of the following topics:
• Java language support for concurrency
• Concurrency utilities (java.util.concurrent package)
• Java collections for multithreading (java.util package)
• Parallel streams in Java 8.
Try out the examples. Source code here: https://github.com/CodeOpsTech/ConcurrentJava
Whats New in Java 5, 6, & 7 (Webinar Presentation - June 2013)DevelopIntelligence
Kelby Zorgdrager from DevelopIntelligence explains the differences between the variations of Java and what's new in Java 7.
If you need help with Java training DevelopIntelligence and provide on-site training within two weeks. Customized and affordable for any organization.
50 nouvelles choses que l'on peut faire avec Java 8José Paumard
Java 8, c'est bien sûr l'arrivée des lambdas, des Stream et des Collectors. Mais ce n'est pas que cela. Plein de nouvelles choses sont aussi offertes : un nouvelle API pour les dates, un nouveau moteur Javascript, une nouvelle version de JavaFX, une nouvelle ConcurrentHashMap, une nouvelle HashMap, des nouveautés dans le domaine de la concurrence, et toutes sortes de petites choses qui vont nous faciliter la vie, que l'on se propose de passer en revue ici.
Presented at BJUG, 6/12/2012 by Roger Brinkley
This talk is on 55 new features in Java 7 you (probably) didn't hear about in an ignite format of one per minute. No stopping, no going back....Questions, sure but only if time remains (otherwise save for later).
Presentation on the new features introduced in JDK 8, presented on the 26.02.2013 in Sofia University in front of students and members of the Bulgarian java user group.
With Java 8 released in March 2014, Oracle Java Technology Ambassador James Weaver discusses many of its new features such as lambda expressions, the stream API, and client-side capabilities with the JavaFX library.
Finally Java SE 7 is GA and you can start using it. This talk will cover the most important new features of the language and the virtual machine. It will also cover some features that did not make it in to the SE 7 release. Finally we will discuss current state of Java as an ecosystem and my analysis and hopes for the future.
Slides for presentation on ZooKeeper I gave at Near Infinity (www.nearinfinity.com) 2012 spring conference.
The associated sample code is on GitHub at https://github.com/sleberknight/zookeeper-samples
Inside the JVM - Follow the white rabbit! / Breizh JUGSylvain Wallez
Presentation given at the Rennes (FR) Java User Group in Feb 2019.
How do we go from your Java code to the CPU assembly that actually runs it? Using high level constructs has made us forget what happens behind the scenes, which is however key to write efficient code.
Starting from a few lines of Java, we explore the different layers that constribute to running your code: JRE, byte code, structure of the OpenJDK virtual machine, HotSpot, intrinsic methds, benchmarking.
An introductory presentation to these low-level concerns, based on the practical use case of optimizing 6 lines of code, so that hopefully you to want to explore further!
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
2. About me
Georgian Micsa
- Software engineer with 5+ years of experience,
mainly Java but also .NET and JavaScript
- Interested in OOP, OOD and agile software development
methodologies
- Currently working as a senior Java developer @ Cegeka
- georgian.micsa@gmail.com
- http://ro.linkedin.com/in/georgianmicsa
2
3. Agenda
Java timeline
Java 7 new features
Future Java 8
References
3
4. Java timeline
1.0 – January 23, 1996
1.1 – February 19, 1997
Inner classes, JavaBeans, JDBC, RMI, reflection
1.2 – December 8, 1998
Strictfp, Swing, JIT compiler, Java IDL, Collections
1.3 – May 8, 2000
HotSpot JVM, JavaSound, JNDI, JPDA, proxies
1.4 – February 6, 2002
Assert, regex, IPv6, NIO, logger, ImageIO, JAXP, JCE, Java Web Start
5 – September 30, 2004
Generics, annotations, auto/unboxing, enum, varargs, foreach loop, static imports,
skinnable look and feel called Synth, java.util.concurrent, Scanner class
6 – December 11, 2006
Scripting language support, performance improvements for Swing, JAX-WS, JDBC 4.0,
StAX, SwingWorker, table sorting and filtering, double-buffering, JVM improvements, Java Quick
Starter, Java2D uses Direct3D on Windows, Nimbus L&F
4
5. New features in Java 7
1. Java programming language
2. Java I/O
3. Concurrency
4. Swing
5. Networking
6. Security
7. Collections
8. RIA
9. Java 2D
10. JDBC 4.1
11. JVM
12. java.lang package
13. Java XML
14. I18N
5
6. 1. Java programming language
Binary Literals:
// An 8-bit 'byte' value:
byte aByte = (byte) 0b00100001;
// A 16-bit 'short' value:
short aShort = (short) 0b1010000101000101;
// Some 32-bit 'int' values:
int anInt1 = 0b10100001010001011010000101000101;
int anInt2 = 0b101;
int anInt3 = 0B101; // The B can be upper or lower case.
// A 64-bit 'long' value. Note the "L" suffix:
long aLong = 0b1000000000000000000001L;
System.out.println(aLong);
6
7. 1. Java programming language
Underscores in Numeric Literals:
long creditCardNumber = 1234_5678_9012_3456L;
long socialSecurityNumber = 999_99_9999L;
float pi = 3.14_15F;
long hexBytes = 0xFF_EC_DE_5E;
long hexWords = 0xCAFE_BABE;
long maxLong = 0x7fff_ffff_ffff_ffffL;
byte nybbles = 0b0010_0101;
long bytes = 0b11010010_01101001_10010100_10010010;
System.out.println(creditCardNumber);
7
8. 1. Java programming language
Strings in Switch Statements:
String myString = "tiger";
switch (myString) {
case "crocodile":
System.out.println("Watch out! It`s a reptile!");
break;
case "tiger":
case "lion":
System.out.println("Watch out! It`s a cat!");
break;
default:
System.out.println("Sorry...Animal not identified");
}
8
9. 1. Java programming language
Type Inference for Generic Instance Creation:
//before 7
Map<String, List<String>> myMap = new HashMap<String, List<String>>();
// DIAMOND operator
//after 7
Map<String, List<String>> myMap2 = new HashMap<>();
9
10. 1. Java programming language
Automatic Resource Management (ARM):
- Also known as 'try-with-resources' statement
- Resources must implement interface AutoClosable
try (ZipFile zf = new ZipFile("test.zip");
FileInputStream fis = new FileInputStream("test.zip");) {
for (Enumeration entries = zf.entries(); entries.hasMoreElements();) {
String zipEntryName = ((java.util.zip.ZipEntry) entries.nextElement()).getName();
System.out.println(zipEntryName);
}
}
10
11. 1. Java programming language
Handling more than one type of exception:
// before 7
catch (IOException ex) {
logger.log(ex);
throw ex;
catch (SQLException ex) {
logger.log(ex);
throw ex;
}
// after 7
catch (IOException|SQLException ex) {
logger.log(ex);
throw ex;
}
11
12. 2. Java I/O
- Completely refactored I/O with better performance
- Packages java.nio.file and java.nio.file.attribute: comprehensive support for file I/O
and for accessing the default file system
- The Path class:
Path p1 = Paths.get("/tmp/foo");
Path p3 = Paths.get(URI.create("file:///Users/joe/FileTest.java"));
Path p5 = Paths.get(System.getProperty("user.home"), "logs", "foo.log");
- Checking files: Files.isRegularFile(path); isReadable(path); isExecutable(path); isDirectory(path);
isHidden(path); size(path); getOwner(); etc.
- Delete file or directory: Files.delete(path);
- Copy file or dir: Files.copy(source, target, REPLACE_EXISTING);
- Move/rename file or dir: Files.move(source, target, REPLACE_EXISTING);
- Read file: fileArray = Files.readAllBytes(path);
- Create file: pathFile.newOutputStream(CREATE, APPEND); Files.createFile(path);
- Random access: interface SeekableByteChannel
- The FileSystems class: FileSystems.getDefault().getFileStores()
- Links: Files.createSymbolicLink(newLink, target); Files.createLink(newLink, existingFile);
- Walking the file tree: the FileVisitor interface
- Finding files: FileSystems.getDefault().getPathMatcher("glob:*.{java,class}");
- Coexistence with legacy code: Path input = file.toPath();
- Custom File System Providers: ex. JAR file system provider
12
13. 2. Java I/O
Directory Watch Service:
WatchService watcher = FileSystems.getDefault().newWatchService();
WatchKey key = dir.register(watcher, StandardWatchEventKinds.ENTRY_CREATE,
StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY);
for (;;) {
//wait for key to be signaled
try {
key = watcher.take();
} catch (InterruptedException x) {
return;
}
for (WatchEvent<?> event : key.pollEvents()) {
WatchEvent.Kind<?> kind = event.kind();
//This key is registered only for ENTRY_CREATE events,
//but an OVERFLOW event can occur regardless if events are
//lost or discarded.
if (kind == StandardWatchEventKinds.OVERFLOW) {
continue;
}
//The filename is the context of the event.
WatchEvent<Path> ev = (WatchEvent<Path>) event;
Path filename = ev.context();
….
13
14. 2. Java I/O
Non-blocking I/O or asynchronous I/O:
A. Return Future representing pending result:
AsynchronousSocketChannel ch = ...
Future<Integer> result = ch.read(buf);
int nread = result.get();
B. CompletionHandler invoked when I/O completes:
interface CompletionHandler<V,A> {
void completed(V result, A attachment);
void failed(Throwable exc, A attachment);
}
ch.read(buf, conn, handler);
- New classes: AsynchronousSocketChannel, AsynchronousServerSocketChannel,
AsynchronousDatagramChannel, AsynchronousFileChannel
- Async operations: READ/WRITE, CONNECT, ACCEPT, RECEIVE/SEND,
14
15. 3. Concurrency
Fork-join framework:
- parallel programming
- based on the ForkJoinPool class (Executor)
- work-stealing technique for the workers
- divide and conquer problems: RecursiveTask and RecursiveAction classes
class ForkSum extends RecursiveTask<Long> {
@Override
protected Long compute() {
if (toIndex - fromIndex <= DIRECT_COMPUTE_SIZE) {
return computeDirectly();
}
int split = (fromIndex + toIndex) / 2;
ForkSum f1 = new ForkSum(array, fromIndex, split);
f1.fork();
ForkSum f2 = new ForkSum(array, split + 1, toIndex);
f2.fork();
return f2.join() + f1.join();
}
//MAIN:
ForkSum forkSum = new ForkSum(computeArray, 0, N - 1);
ForkJoinPool pool = new ForkJoinPool(); // uses number of cores
Long result = pool.invoke(forkSum);
15
16. 3. Concurrency
- The ThreadLocalRandom class eliminates contention among threads using pseudo-random numbers
- For concurrent access (fork-join framework), using ThreadLocalRandom instead of Math.random()
results in less contention and, ultimately, better performance.
int r = ThreadLocalRandom.current().nextInt(4, 77);
- The Phaser class is a new synchronization barrier, similar to CyclicBarrier
- More flexible usage
- Number of parties registered to synchronize on a phaser may vary over time: register(), bulkRegister(),
arriveAndDeregister();
- Better synchronization: arriveAndAwaitAdvance(), arrive(), arriveAndDeregister(),
awaitAdvance(int phase)
- Termination: isTerminated(), forceTermination()
- Monitoring: getRegisteredParties(), getArrivedParties(), getPhase(), getUnarrivedParties()
- Tiering: Build phasers in tree structure to reduce contention.
16
17. 4. Swing
- The JLayer class has been added, which is a flexible and powerful decorator for Swing components
- You can draw effects, blurring, animating a busy indicator, validate textfields, respond to events etc.
JFrame f = new JFrame();
JPanel panel = createPanel();
LayerUI<JPanel> layerUI = new WallpaperLayerUI();
JLayer<JPanel> jlayer = new JLayer<JPanel>(panel, layerUI);
f.add (jlayer);
class WallpaperLayerUI extends LayerUI<JComponent> {
public void paint(Graphics g, JComponent c) {
...
}
}
- The Nimbus Look and Feel has been moved from the com.sun.java.swing package
to the javax.swing package
- Mixing Heavyweight and Lightweight Components is easier to accomplish
- Windows with transparency and non-rectangular shape are supported
// Set the window to 55% opaque (45% translucent).
w.setOpacity(0.55f);
// Shaped windows
w.setShape(new Ellipse2D.Double(0,0,getWidth(),getHeight()));
- An HSV tab has been added to the JColorChooser class
17
18. 5. Networking
- The URLClassLoader.close() method has been added
- Invalidates the loader
- It also closes any JAR files - this allows the application to delete or replace these files
- The Sockets Direct Protocol (SDP) provides access to high performance network connections
- Introduced in 1999 by the InfiniBand Trade Association,
InfiniBand (IB) was created to address the need for high performance computing
- Remote Direct Memory Access (RDMA):
- enables moving data directly from the memory of one computer to another computer
- bypassing the operating system of both computers
- resulting in significant performance gains
- SDP supports stream connections over InfiniBand fabric
- No API changes required in JDK
- The implementation of SDP is transparent and supported by the classic networking and new I/O
- You only have to create a configuration file. Example:
# Use SDP when binding to 192.0.2.1
bind 192.0.2.1 *
# Use SDP when connecting to all application services on 192.0.2.*
connect 192.0.2.0/24 1024-*
18
19. 6. Security
- Support for Elliptic Curve Cryptography (ECC)
- A new native provider has been added that provides several ECC-based algorithms (ECDSA/ECDH):
- DSA Signatures using ECC
- Key agreement: Diffie-Hellman key exchange using ECC
- Weak cryptographic algorithms can now be disabled, for example MD2
- Various enhancements related to SSL/TLS have been added to Java Secure Socket Extension
19
20. 7. Collections
- The TransferQueue interface has been added
- A refinement of the BlockingQueue interface:
- producers may wait for consumers to receive elements
- transfer(E e)
- tryTransfer(E e)
- tryTransfer(E e, long timeout, TimeUnit unit)
- getWaitingConsumerCount()
- hasWaitingConsumer()
- The class LinkedTransferQueue implements the TransferQueue interface
20
21. 8. RIA
- The window of a dragged applet can be decorated with a default or custom title
- Enhancements have been made to the syntax of JNLP files:
- The os attribute in the information and resources elements can now contain
specific versions of Windows
- Applications can use the install attribute in the shortcut element
- Java Web Start applications can be deployed without specifying the codebase attribute
- A JNLP file can be embedded into an HTML page:
<script src="http://www.java.com/js/deployJava.js"></script>
<script>
var attributes = {} ;
<!-- Base64 encoded string truncated below for readability -->
var parameters = {jnlp_href: 'dynamictree-applet.jnlp',
jnlp_embedded: 'PCEtLSAKLyoKICogQ29weX ... HA+Cg=='
};
deployJava.runApplet(attributes, parameters, '1.6');
</script>
- You can check the status variable of the applet while it is loading to determine
if the applet is ready to handle requests from JavaScript code
21
22. 9. Java 2D
- A new XRender-based Java 2D rendering pipeline is supported for modern X11-based desktops,
offering improved graphics performance:
-Dsun.java2d.xrender=true
- The JDK now enumerates and displays installed OpenType/CFF fonts
through methods such as GraphicsEnvironment.getAvailableFontFamilyNames
22
23. 10. JDBC 4.1
- The ability to use a try-with-resources statement to automatically close
resources of type Connection, ResultSet, and Statement:
try (Statement stmt = con.createStatement()) {
// ...
}
- RowSet 1.1: The introduction of the RowSetFactory interface and the RowSetProvider class
- Enable you to create all types of row sets supported by your JDBC driver
- JdbcRowSet:
- enhanced ResultSet object
- it maintains a connection to its data source
- it has a set of properties and a listener notification mechanism
- it makes a ResultSet object scrollable and updatable
- The RowSetFactory interface:
- createCachedRowSet
- createFilteredRowSet
- createJdbcRowSet
- createJoinRowSet
- createWebRowSet
23
24. 11. JVM
JVM Support for Non-Java Languages
- Dynamically typed language => type checking at runtime
- New JVM instruction that simplifies the implementation of dynamically typed
programming languages on the JVM: invokedynamic
- Allows the language implementer to define custom linkage behavior
- Define bootstrap method that links the invokedynamic call site to the “real” method
Garbage-First Collector
- Server-style garbage collector that replaces the Concurrent Mark-Sweep Collector (CMS)
- Targeted for multi-processors with large memories, decrease pause times and increase throughput
- Marking and evacuation is performed on parallel on multi-processors
- G1 partitions the Heap in equal size regions and compacts them
- G1 first collects and compacts the regions full of reclaimable objects
- More predictable garbage collection pauses than CMS
- User can set the desired pause targets
Java HotSpot Virtual Machine Performance Enhancements
- Tiered Compilation => speed up the server VM: -server -XX:+TieredCompilation
- Compressed Oops – managed pointers for objects offsets and not byte offsets
- Escape analysis
- compiler may eliminate certain object allocations
- compiler may eliminate synchronization blocks (lock elision)
- NUMA Collector enhancements for the parallel GC
24
25. java.lang, XML & I18N
12. java.lang package
- Potential deadlocks were eliminated for multithreaded, non-hierarchically delegating
custom class loaders
13. Java XML
- Java API for XML Processing (JAXP) 1.4.5,
- Java Architecture for XML Binding (JAXB) 2.2.3,
- Java API for XML Web Services (JAX-WS) 2.2.4
14. I18N
- Support for Unicode 6.0.0:
- over 2000 additional characters, as well as support for properties and data files
- by default in Java 1 char = 16 bits => only 65536 characters
- supplementary characters are defined as a pair of char values, from 0x10000 to 0x10FFFF
- Extensible Support for ISO 4217 Currency Codes: currency.properties
- Category Locale Support: 2 types of category: Locale.Category FORMAT and DISPLAY
- Unicode 6.0 Support in Regular Expressions API
25
26. Future Java 8
- Modularization of the JDK under Project Jigsaw
- Parts of project Coin that are not included in Java 7
- Language-level support for lambda expressions
(officially, lambda expressions; unofficially, closures)
under Project Lambda:
Collection collection = ... ;
collection.sortBy(#{ Foo f -> f.getLastName() });
collection.remove(#{ Foo f -> f.isBlue() });
- Annotations on Java Types:
Map<@NonNull String, @NonEmpty List<@Readonly Document>> files;
- New Date and Time API
26