Slides from my JAX London 2016 talk, discussing how the new features affect library design. Follows on from the Java SE 8 Best Practices talk - http://www.slideshare.net/scolebourne/java-se-8-best-practices-53975908
Lambdas and streams are key new features in Java 8. Lambdas allow blocks of code to be passed around as if they were objects. Streams provide an abstraction for processing collections of objects in a declarative way using lambdas. Optional is a new class that represents null-safe references and helps avoid null pointer exceptions. Checked exceptions can cause issues with lambdas, so helper methods are recommended to convert checked exceptions to unchecked exceptions.
The document outlines many new features and enhancements coming in Java SE 8, including lambda expressions, extension methods, annotations on types, stream API additions, date and time API improvements, security enhancements, and virtual machine optimizations. It also discusses the ongoing process for Java enhancement proposals and modularization preparation work.
Introduction to functional idioms in Java 8, language-extending functional libraries and short overview of reasons for adoption of such programming style.
Examples and snippets available here: https://github.com/lbialy/functionaljava8
This document discusses new features in Java 8 including stream API, lambdas, default methods, optional values, date and time API, stamped locks, concurrent adders, improved annotations, new file operations, overflow operations, and the Nashorn JavaScript engine. It provides code examples and explanations of how to use these new features in Java 8.
The document discusses new features in Java 8 including lambda expressions, default methods in interfaces, streams API and functional interfaces. Lambda expressions allow representing anonymous functions and can be used to filter, map and process collections. Default methods allow adding new methods to interfaces without breaking existing implementations. Streams API provides a way to process data pipelines in a declarative way and supports parallel and sequential operations on collections.
Java 8 introduced many new features including lambda expressions, default methods in interfaces, streams API and date/time API improvements. Lambda expressions allow passing code as data and functional interfaces help utilize lambda expressions. Default methods allow adding new methods to interfaces while maintaining backwards compatibility. The streams API enables functional-style operations on collections through intermediate and terminal operations. The new date/time API in Java 8 addresses shortcomings in previous date/time classes.
My presentation slides in KMS TechCon 2014, an internal technology event at KMS Technology Vietnam company.
"Java 8 is one of the most highly anticipated programming language updates in many years. Let me give you an introduction about its new features: Lambda expressions, Method references, Default Methods, Stream API, new JS Engine, new Date/Time API and more..."
Default methods and static methods allow interfaces to define new methods without breaking existing implementations. The lambda expressions feature introduces functional programming to Java through functional interfaces like Consumer and Function. The streams API provides a functional-style way to process and analyze collections through parallelization, optional return values, and collectors.
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.
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsEmiel Paasschens
Lambda expressions and streams are major new features in Java 8. Lambda expressions allow treating functionality as a method argument or variable. Streams provide a new way to process collections of objects in a declarative way using intermediate and terminal operations. The document provides examples of lambda expressions, method references, functional interfaces, default methods on interfaces, and stream operations like filter, map, and reduce.
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.
Improved Developer Productivity In JDK8Simon Ritter
The document discusses new features in Java SE 8 that improve developer productivity. It describes lambda expressions and method references that allow for more functional-style programming. It also covers streams, which provide a way to process collections of objects in a declarative way and support aggregate operations. Default methods are discussed as a means to evolve library APIs in a backwards compatible way.
Java 8 will include many new features including lambdas, default methods on interfaces, and a date/time API. Lambdas allow implementing functional interfaces with expression syntax rather than anonymous classes, and method references allow referring to methods without invoking them. Default methods allow adding new functionality to interfaces without breaking existing implementations. The new date/time API in JSR-310 provides improved date/time handling functionality.
Java 8 includes new features such as lambda expressions for functional programming, streams API for bulk data operations, date and time API improvements, and miscellaneous enhancements. It also removes some deprecated features and improves performance.
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaSimon Ritter
The document discusses Java 8 lambdas and streams. It introduces lambda expressions as anonymous functions that can represent behavior parameterization. Lambda expressions allow simplified syntax compared to anonymous inner classes. Streams represent sequential, parallel, and bulk data processing and can be constructed from collections, arrays, or generated. Stream pipelines consist of sources, intermediate operations, and terminal operations to produce results or side effects. The Optional class helps eliminate NullPointerExceptions by wrapping nullable values.
This document summarizes the key new features included in JDK 7. It discusses Project Coin which added features like string switching, binary literals, and the diamond operator. It also covers try-with-resources for improved exception handling, fork/join framework for parallel programming, and NIO.2 features like asynchronous I/O, watch service for monitoring file changes, and pluggable file systems.
Presentation from Riga Dev Day talking about Lambda expressions and the Stream API in JDK8. This session, as the title suggests, goes beyond the basics and discusses some of the different ways you need to think to use a functional style of programming in Java.
Java 8 came out early last year and Java 7 is now, at the end of life, making Java 8 the only Oracle supported option. However, since developers value stability over trendiness, many of us are still working with Java 7, or even 6. Let’s look at some features of Java 8, and provide some arguments to persuade your code to upgrade with best practices.
This document contains the notes from a presentation on best practices for Java 8. It discusses 10 topics: 1) general adoption of Java 8, 2) lambdas and method references, 3) functional interfaces, 4) Optional, 5) streams and collections, 6) streams outside of collections, 7) functional programming with strings, 8) parallel streams, 9) simplifying design patterns with functional programming, and 10) other Java 8 features. For each topic, it provides high-level best practices such as preferring method references to lambdas, avoiding null returns, and testing that parallel streams provide real performance benefits.
Java is Object Oriented Programming. Java 8 is the latest version of the Java which is used by many companies for the development in many areas. Mobile, Web, Standalone applications.
Presentation provides introduction and detailed explanation of the Java 8 Lambda and Streams. Lambda covers with Method references, default methods and Streams covers with stream operations,types of streams, collectors. Also streams are elaborated with parallel streams and benchmarking comparison of sequential and parallel streams.
Additional slides are covered with Optional, Splitators, certain projects based on lambda and streams
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon RitterJAXLondon2014
This document provides an overview of lambdas and streams in Java 8. It discusses how lambdas allow for more functional-style programming by supporting anonymous functions. Streams provide a way to perform aggregate operations on collections in a declarative way, using internal iteration with lambdas rather than external iteration. Key aspects covered include lambda expression syntax and type inference, method and constructor references, default and static methods in interfaces, and functional interfaces.
This document contains the slides for a presentation on Java 8 Lambdas and Streams. The presentation will cover lambdas, including their concept, syntax, functional interfaces, variable capture, method references, and default methods. It will also cover streams. The slides provide some incomplete definitions that will be completed during the presentation. Questions from attendees are welcome. A quick survey asks about past experience with lambdas and streams.
Slides from my madlab presentation on Java 8 (July 2014), full slides and source here:
https://github.com/markglh/Java8Madlab-Slides
A code review is basically a technical discussion which should lead to improvements in the code and/or sharing
knowledge in a team. As with any conversation, it should have substance and form.
What’s involved in a good code review? What kind of problems do we want to spot and address? Trisha Gee will talk
about things a reviewer may consider when looking at changes: what potential issues to look for; why certain
patterns may be harmful; and, of course, what NOT to look at.
But when it comes to commenting on someone’s work, it may be hard to find the right words to convey a useful message
without offending the authors - after all, this is something that they worked hard on. Maria Khalusova will share
some observations, thoughts and practical tricks on how to give and receive feedback without turning a code review
into a battlefield.
Presentation made by [Michael Suriano, NBBJ and Tracy Anne Perry, NBBJ] at the IFLA Library Buildings and Equipment Satellite Meeting, Illinois Institute of Technology, Chicago, Aug.10-11, 2016.
Default methods and static methods allow interfaces to define new methods without breaking existing implementations. The lambda expressions feature introduces functional programming to Java through functional interfaces like Consumer and Function. The streams API provides a functional-style way to process and analyze collections through parallelization, optional return values, and collectors.
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.
Introduction of Java 8 with emphasis on Lambda Expressions and StreamsEmiel Paasschens
Lambda expressions and streams are major new features in Java 8. Lambda expressions allow treating functionality as a method argument or variable. Streams provide a new way to process collections of objects in a declarative way using intermediate and terminal operations. The document provides examples of lambda expressions, method references, functional interfaces, default methods on interfaces, and stream operations like filter, map, and reduce.
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.
Improved Developer Productivity In JDK8Simon Ritter
The document discusses new features in Java SE 8 that improve developer productivity. It describes lambda expressions and method references that allow for more functional-style programming. It also covers streams, which provide a way to process collections of objects in a declarative way and support aggregate operations. Default methods are discussed as a means to evolve library APIs in a backwards compatible way.
Java 8 will include many new features including lambdas, default methods on interfaces, and a date/time API. Lambdas allow implementing functional interfaces with expression syntax rather than anonymous classes, and method references allow referring to methods without invoking them. Default methods allow adding new functionality to interfaces without breaking existing implementations. The new date/time API in JSR-310 provides improved date/time handling functionality.
Java 8 includes new features such as lambda expressions for functional programming, streams API for bulk data operations, date and time API improvements, and miscellaneous enhancements. It also removes some deprecated features and improves performance.
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaSimon Ritter
The document discusses Java 8 lambdas and streams. It introduces lambda expressions as anonymous functions that can represent behavior parameterization. Lambda expressions allow simplified syntax compared to anonymous inner classes. Streams represent sequential, parallel, and bulk data processing and can be constructed from collections, arrays, or generated. Stream pipelines consist of sources, intermediate operations, and terminal operations to produce results or side effects. The Optional class helps eliminate NullPointerExceptions by wrapping nullable values.
This document summarizes the key new features included in JDK 7. It discusses Project Coin which added features like string switching, binary literals, and the diamond operator. It also covers try-with-resources for improved exception handling, fork/join framework for parallel programming, and NIO.2 features like asynchronous I/O, watch service for monitoring file changes, and pluggable file systems.
Presentation from Riga Dev Day talking about Lambda expressions and the Stream API in JDK8. This session, as the title suggests, goes beyond the basics and discusses some of the different ways you need to think to use a functional style of programming in Java.
Java 8 came out early last year and Java 7 is now, at the end of life, making Java 8 the only Oracle supported option. However, since developers value stability over trendiness, many of us are still working with Java 7, or even 6. Let’s look at some features of Java 8, and provide some arguments to persuade your code to upgrade with best practices.
This document contains the notes from a presentation on best practices for Java 8. It discusses 10 topics: 1) general adoption of Java 8, 2) lambdas and method references, 3) functional interfaces, 4) Optional, 5) streams and collections, 6) streams outside of collections, 7) functional programming with strings, 8) parallel streams, 9) simplifying design patterns with functional programming, and 10) other Java 8 features. For each topic, it provides high-level best practices such as preferring method references to lambdas, avoiding null returns, and testing that parallel streams provide real performance benefits.
Java is Object Oriented Programming. Java 8 is the latest version of the Java which is used by many companies for the development in many areas. Mobile, Web, Standalone applications.
Presentation provides introduction and detailed explanation of the Java 8 Lambda and Streams. Lambda covers with Method references, default methods and Streams covers with stream operations,types of streams, collectors. Also streams are elaborated with parallel streams and benchmarking comparison of sequential and parallel streams.
Additional slides are covered with Optional, Splitators, certain projects based on lambda and streams
Lambdas and Streams in Java SE 8: Making Bulk Operations simple - Simon RitterJAXLondon2014
This document provides an overview of lambdas and streams in Java 8. It discusses how lambdas allow for more functional-style programming by supporting anonymous functions. Streams provide a way to perform aggregate operations on collections in a declarative way, using internal iteration with lambdas rather than external iteration. Key aspects covered include lambda expression syntax and type inference, method and constructor references, default and static methods in interfaces, and functional interfaces.
This document contains the slides for a presentation on Java 8 Lambdas and Streams. The presentation will cover lambdas, including their concept, syntax, functional interfaces, variable capture, method references, and default methods. It will also cover streams. The slides provide some incomplete definitions that will be completed during the presentation. Questions from attendees are welcome. A quick survey asks about past experience with lambdas and streams.
Slides from my madlab presentation on Java 8 (July 2014), full slides and source here:
https://github.com/markglh/Java8Madlab-Slides
A code review is basically a technical discussion which should lead to improvements in the code and/or sharing
knowledge in a team. As with any conversation, it should have substance and form.
What’s involved in a good code review? What kind of problems do we want to spot and address? Trisha Gee will talk
about things a reviewer may consider when looking at changes: what potential issues to look for; why certain
patterns may be harmful; and, of course, what NOT to look at.
But when it comes to commenting on someone’s work, it may be hard to find the right words to convey a useful message
without offending the authors - after all, this is something that they worked hard on. Maria Khalusova will share
some observations, thoughts and practical tricks on how to give and receive feedback without turning a code review
into a battlefield.
Presentation made by [Michael Suriano, NBBJ and Tracy Anne Perry, NBBJ] at the IFLA Library Buildings and Equipment Satellite Meeting, Illinois Institute of Technology, Chicago, Aug.10-11, 2016.
The document provides information on several public library design projects, including:
1) The Bown Crossing Public Library preliminary design which aimed to provide community space, inspire all ages, and reflect the local environment in a sustainable building.
2) The Lawrence Public Library expansion which wrapped the existing building to create a community hub, adding spaces for different ages and improving energy efficiency.
3) The Washington Highlands Library designed by Adjaye Associates to lift public spaces above street level and provide views of the neighborhood in energy efficient geometric forms.
4) The Dougherty Station Public Library master plan which created a new library as part of a larger community center in an integrated development.
5) The V
The Peckham Library in London was designed by Alsop Architects to revitalize the economically depressed area of Southwark and challenge stereotypes of libraries. The pre-patinated copper facade deters crime while allowing interior spaces filled with natural light. Pods and columns divide the interior into intimate reading nooks. Sustainability was prioritized through maximizing natural light, ventilation, and using low-maintenance materials. The striking and welcoming design has boosted the neighborhood's reputation.
This document outlines architectural standards for a senior secondary school. It provides requirements for various teaching spaces including standard classrooms, science labs, a library, auditorium, play areas, and gymnasium. It also includes standards for administrative spaces, sanitation facilities, and other support spaces. Requirements include the size, shape, floor area, and special provisions for different types of rooms. Ventilation, electrical services, and accessibility are also addressed according to their functions.
The document discusses the benefits of exercise for mental health. It states that regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help alleviate symptoms of mental illness.
The document discusses whether the Groovy programming language is better than Java for testing. It outlines some of the pros and cons of each approach. While Java and JUnit tests are performant and well-supported, Groovy and the Spock testing framework make tests more readable, easier to write, and help describe expected system behavior through features like mocking and hamcrest matchers. Migrating existing Java tests to Groovy would require learning a new language but allow exploring its testing advantages without impacting production code. In conclusion, both have tradeoffs and the best approach depends on the specific project needs and developer preferences.
Nancy Gray envisioned a public arts program and sculpture garden for Lampasas, TX in 2005. She recruited three sculptors to carve limestone blocks donated by a local quarry in Campbell Park. Over 2,000 visitors viewed the sculptures as they were carved over two weeks. Gray later founded the Lampasas Association for the Arts to continue the sculpture garden, selecting five new sculptures annually from nationwide entries. As of 2015, the Hanna Springs Sculpture Garden has grown to 15 sculptures and celebrates its 10th anniversary.
North Carolina's Fearrington Village is home to many artists. Dr. Forrest Greenslade lives and creates there. He exhibits his sculpture and paintings in the Forrest Dweller Sculpture Garden and Gallery. Take a pictorial tour.
The document proposes updating the 2010 PAARL Library Standards. It notes that standards should provide guidance towards an ideal rather than just represent averages. It reviews key areas to assess libraries, including their collections, organization, staff, and services. The presentation discusses why standards need updating given changes in technology, roles of libraries, and information environments. It outlines the process for revising standards, including gathering input through surveys and discussions. Significant changes proposed include recognizing multiple formats for collections, emphasizing access over ownership, incorporating library 2.0 concepts, and expanding services for distance learning.
The document discusses Joseph Wright works that are housed at the Yale Center for British Art. It contains images of art galleries at the National Gallery of Art in Washington DC and the Boston Museum of Fine Arts. The Yale Center for British Art exhibits some paintings by Joseph Wright.
Library Design for the 21st Century Learner: CEFPI Southern Regiontechnolibrary
This document summarizes a presentation about library design for 21st century learners. It discusses trends showing how student technology use and learning styles are changing. This impacts the need for new types of library spaces that are flexible, collaborative, and integrate technology. The presentation provides a case study of how one high school library was renovated by gathering input from students and staff and reconfiguring the space to improve visibility, access to natural light, and allow different types of quiet and active learning areas. The goal is for the library to serve as a learning commons that supports different modalities of independent and group work in a flexible, technology-rich environment.
Though revolutionary in many ways, digital photography is essentially electronically implemented film photography. By contrast, computational photography exploits plentiful low-cost computing and memory, new kinds of digitally enabled sensors, optics, probes, smart lighting, and communication to capture information far beyond just a simple set of pixels. It promises a richer, even a multilayered, visual experience that may include depth, fused photo-video representations, or multispectral imagery. Professor Raskar will discuss and demonstrate advances he is working on in the areas of generalized optics, sensors, illumination methods, processing, and display, and describe how computational photography will enable us to create images that break from traditional constraints to retain more fully our fondest and most important memories, to keep personalized records of our lives, and to extend both the archival and the artistic possibilities of photography.
This document is a project report for a Library Management System developed by Karan Singhal. It includes an abstract, scope, system requirements, architecture, design, and planning. The system was developed using Java and MySQL to automate library processes like book/member management, transactions, and reporting. The future sections will cover implementation details and testing results.
The document discusses best practices for API design. It covers topics such as considering the perspective of the caller, keeping APIs simple, striving for consistency, choosing memorable names, specifying behavior, making APIs safe, anticipating evolution, and writing helpful documentation. The overall message is that API design has a significant impact and requires careful consideration to create interfaces that are intuitive, easy to use, and stand the test of time.
The document discusses the importance of visual art and design. It notes that art is a universal language that enhances cultural appreciation. It then lists several reasons why art is important, including for self-expression, flow states, developing independence and collaboration skills, and improving academic achievement. The document also discusses why people make art, including for religious purposes, honoring the dead, a connection to nature, and functional purposes. It finally covers the basic elements of design like line, shape, color, and principles of design such as balance, movement, emphasis and unity.
1. The document discusses using technology like Blackboard to teach visual art education, providing course content, notes, assignments, grades, and communication for students.
2. Over 400 students used Blackboard for their visual art theoretical work, submitting assignments online and receiving marks and feedback immediately.
3. Other technologies used included projecting teaching journals, student work, and gallery visits onto a whiteboard, using smartphones to communicate, and creating digital work like photography or animations for students.
An overview of software engineering project (MSc Thesis) to objectively evaluate the benefits and drawbacks of using Model-Driven Engineering tools on Eclipse Modelling Framework (EMF) such as Epsilon and Xtext to implement a compiler for a sufficiently complex intermediate language. The results seem promising.
For more imnformation, please see this blog post:
http://modeling-languages.com/re-implementing-apache-thrift-with-mde/
This document summarizes key parts of Java 8 including lambda expressions, method references, default methods, streams API improvements, removal of PermGen space, and the new date/time API. It provides code examples and explanations of lambda syntax and functional interfaces. It also discusses advantages of the streams API like lazy evaluation and parallelization. Finally, it briefly outlines the motivation for removing PermGen and standardizing the date/time API in Java 8.
This document discusses new features in JDK 8 including lambda expressions, method references, default methods in interfaces, date and time API improvements, Nashorn JavaScript engine, parameter names in reflection, and annotation improvements. It also briefly mentions JEPs and upcoming features for JDK 9 such as modularity. The presenter provides code examples and explanations for many of the new JDK 8 language and API features.
The document provides suggestions for using various new C++11 language features in ATS coding, focusing on features that are most useful. It discusses nullptr, auto, range-based for loops, delegating constructors, prohibiting/defaulting methods, member initialization, override, explicit conversion operators, std::unique_ptr, lambdas, std::function, constexpr, and provides code examples for many of these features. The overall aim is to take advantage of new language features to improve ATS code without overusing them in a way that makes the code harder to understand.
This document discusses several modern Java features including try-with-resources for automatic resource management, Optional for handling null values, lambda expressions, streams for functional operations on collections, and the new Date and Time API. It provides examples and explanations of how to use each feature to improve code quality by preventing exceptions, making code more concise and readable, and allowing functional-style processing of data.
These are the slides to the webinar about Custom Pregel algorithms in ArangoDB https://youtu.be/DWJ-nWUxsO8. It provides a brief introduction to the capabilities and use cases for Pregel.
Building Your First Apache Apex ApplicationApache Apex
This document provides an overview of building an Apache Apex application, including key concepts like DAGs, operators, and ports. It also includes an example "word count" application and demonstrates how to define the application and operators, and build Apache Apex from source code. The document outlines the sample application workflow and includes information on resources for learning more about Apache Apex.
This document provides an overview of building an Apache Apex application, including key concepts like DAGs, operators, and ports. It also includes an example "word count" application and demonstrates how to define the application and operators, and build Apache Apex from source code. The document outlines the sample application workflow and includes information on resources for learning more about Apache Apex.
Design and Implementation of the Security Graph LanguageAsankhaya Sharma
Today software is built in fundamentally different
ways from how it was a decade ago. It is increasingly common
for applications to be assembled out of open-source components,
resulting in the use of large amounts of third-party code. This
third-party code is a means for vulnerabilities to make their
way downstream into applications. Recent vulnerabilities such
as Heartbleed, FREAK SSL/TLS, GHOST, and the Equifax data
breach (due to a flaw in Apache Struts) were ultimately caused
by third-party components. We argue that an automated way to
audit the open-source ecosystem, catalog existing vulnerabilities,
and discover new flaws is essential to using open-source safely.
To this end, we describe the Security Graph Language (SGL), a
domain-specific language for analysing graph-structured datasets
of open-source code and cataloguing vulnerabilities. SGL allows
users to express complex queries on relations between libraries
and vulnerabilities in the style of a program analysis language.
SGL queries double as an executable representation for vulnerabilities, allowing vulnerabilities to be automatically checked
against a database and deduplicated using a canonical representation. We outline a novel optimisation for SGL queries based on
regular path query containment, improving query performance up to 3 orders of magnitude. We also demonstrate the
effectiveness of SGL in practice to find zero-day vulnerabilities
by identifying sever
Hadoop and HBase experiences in perf log projectMao Geng
This document discusses experiences using Hadoop and HBase in the Perf-Log project. It provides an overview of the Perf-Log data format and architecture, describes how Hadoop and HBase were configured, and gives examples of using MapReduce jobs and HBase APIs like Put and Scan to analyze log data. Key aspects covered include matching Hadoop and HBase versions, running MapReduce jobs, using column families in HBase, and filtering Scan results.
The document discusses Java 8 lambda expressions and how they improved Java by allowing for anonymous functions. It provides examples of code before and after Java 8 that demonstrate lambda expressions providing a clearer syntax compared to anonymous inner classes. Specifically, it shows how lambda expressions allowed sorting a list of strings in a more readable way. It also discusses how functions can be treated as data by being passed as parameters or returned from other functions.
This document provides an overview and summary of new features in Java 8. It begins with the schedule and release dates for Java 8 from 2012 to 2014. The major changes covered include lambda expressions, which allow passing code as data and are enabled by default functional interfaces. The new date/time API provides a modern replacement for the legacy Date/Calendar APIs. Type annotations allow adding metadata to types. Compact profiles define modular class libraries. Overall, Java 8 aims to better support parallel programming through new language features and library APIs.
Unifying Frontend and Backend Development with Scala - ScalaCon 2021Taro L. Saito
Scala can be used for developing both frontend (Scala.js) and backend (Scala JVM) applications. A missing piece has been bridging these two worlds using Scala. We built Airframe RPC, a framework that uses Scala traits as a unified RPC interface between servers and clients. With Airframe RPC, you can build HTTP/1 (Finagle) and HTTP/2 (gRPC) services just by defining Scala traits and case classes. It simplifies web application design as you only need to care about Scala interfaces without using existing web standards like REST, ProtocolBuffers, OpenAPI, etc. Scala.js support of Airframe also enables building interactive Web applications that can dynamically render DOM elements while talking with Scala-based RPC servers. With Airframe RPC, the value of Scala developers will be much higher both for frontend and backend areas.
This document introduces lambda expressions in Java 8. It provides background on why lambda expressions were added to Java, including to allow for more functional programming and parallel processing. It covers the syntax of lambda expressions, when they should and should not be used, functional interfaces, method and constructor references, referencing external variables, debugging lambda expressions, and new lambda methods added in Java 8. The document also advertises exercises for the reader to complete to practice using lambda expressions.
Cover Basic concept for Functional Programming in Java. Define new functional interfaces, lambda expressions, how to translate lambda expression, JVM deal with new byte code etc. This is not the perfect slides for functional programming, but trying cover simple basic functional programming.
Dart is a new language for the web, enabling you to write JavaScript on a secure and manageable way. No need to worry about "JavaScript: The bad parts".
This presentation concentrates on the developer experience converting from the Java based GWT to Dart.
The document discusses the requirements and architecture of an SDN controller. It states that an SDN controller should be a flexible platform that can accommodate diverse applications through common APIs and extensibility. It should also scale to support independent development and integration of applications. The OpenDaylight controller satisfies these requirements through its use of YANG modeling and the Model-Driven Service Abstraction Layer (MD-SAL). MD-SAL generates Java classes from YANG models and provides messaging between controller components.
The document discusses new features in Java 8 including lambda expressions, default methods, streams, and static methods in interfaces. Lambda expressions allow for anonymous functions and method references provide shorthand syntax. Default methods enable adding new functionality to interfaces while maintaining binary compatibility. Streams support sequential and parallel aggregate operations on a sequence of elements. Static methods can now be defined in interfaces.
Explores and discusses benefits of functional programming in Java and how to program in a functional style. Watch Venkat Subramaniam's talk at https://youtu.be/Ee5t_EGjv0A if you would like to learn more.
Download YouTube By Click 2025 Free Full Activatedsaniamalik72555
Copy & Past Link 👉👉
https://dr-up-community.info/
"YouTube by Click" likely refers to the ByClick Downloader software, a video downloading and conversion tool, specifically designed to download content from YouTube and other video platforms. It allows users to download YouTube videos for offline viewing and to convert them to different formats.
Why Orangescrum Is a Game Changer for Construction Companies in 2025Orangescrum
Orangescrum revolutionizes construction project management in 2025 with real-time collaboration, resource planning, task tracking, and workflow automation, boosting efficiency, transparency, and on-time project delivery.
This presentation explores code comprehension challenges in scientific programming based on a survey of 57 research scientists. It reveals that 57.9% of scientists have no formal training in writing readable code. Key findings highlight a "documentation paradox" where documentation is both the most common readability practice and the biggest challenge scientists face. The study identifies critical issues with naming conventions and code organization, noting that 100% of scientists agree readable code is essential for reproducible research. The research concludes with four key recommendations: expanding programming education for scientists, conducting targeted research on scientific code quality, developing specialized tools, and establishing clearer documentation guidelines for scientific software.
Presented at: The 33rd International Conference on Program Comprehension (ICPC '25)
Date of Conference: April 2025
Conference Location: Ottawa, Ontario, Canada
Preprint: https://arxiv.org/abs/2501.10037
Not So Common Memory Leaks in Java WebinarTier1 app
This SlideShare presentation is from our May webinar, “Not So Common Memory Leaks & How to Fix Them?”, where we explored lesser-known memory leak patterns in Java applications. Unlike typical leaks, subtle issues such as thread local misuse, inner class references, uncached collections, and misbehaving frameworks often go undetected and gradually degrade performance. This deck provides in-depth insights into identifying these hidden leaks using advanced heap analysis and profiling techniques, along with real-world case studies and practical solutions. Ideal for developers and performance engineers aiming to deepen their understanding of Java memory management and improve application stability.
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDinusha Kumarasiri
AI is transforming APIs, enabling smarter automation, enhanced decision-making, and seamless integrations. This presentation explores key design principles for AI-infused APIs on Azure, covering performance optimization, security best practices, scalability strategies, and responsible AI governance. Learn how to leverage Azure API Management, machine learning models, and cloud-native architectures to build robust, efficient, and intelligent API solutions
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Versionsaimabibi60507
Copy & Past Link👉👉
https://dr-up-community.info/
Pixologic ZBrush, now developed by Maxon, is a premier digital sculpting and painting software renowned for its ability to create highly detailed 3D models. Utilizing a unique "pixol" technology, ZBrush stores depth, lighting, and material information for each point on the screen, allowing artists to sculpt and paint with remarkable precision .
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMaxim Salnikov
Imagine if apps could think, plan, and team up like humans. Welcome to the world of AI agents and agentic user interfaces (UI)! In this session, we'll explore how AI agents make decisions, collaborate with each other, and create more natural and powerful experiences for users.
Interactive Odoo Dashboard for various business needs can provide users with dynamic, visually appealing dashboards tailored to their specific requirements. such a module that could support multiple dashboards for different aspects of a business
✅Visit And Buy Now : https://bit.ly/3VojWza
✅This Interactive Odoo dashboard module allow user to create their own odoo interactive dashboards for various purpose.
App download now :
Odoo 18 : https://bit.ly/3VojWza
Odoo 17 : https://bit.ly/4h9Z47G
Odoo 16 : https://bit.ly/3FJTEA4
Odoo 15 : https://bit.ly/3W7tsEB
Odoo 14 : https://bit.ly/3BqZDHg
Odoo 13 : https://bit.ly/3uNMF2t
Try Our website appointment booking odoo app : https://bit.ly/3SvNvgU
👉Want a Demo ?📧 [email protected]
➡️Contact us for Odoo ERP Set up : 091066 49361
👉Explore more apps: https://bit.ly/3oFIOCF
👉Want to know more : 🌐 https://www.axistechnolabs.com/
#odoo #odoo18 #odoo17 #odoo16 #odoo15 #odooapps #dashboards #dashboardsoftware #odooerp #odooimplementation #odoodashboardapp #bestodoodashboard #dashboardapp #odoodashboard #dashboardmodule #interactivedashboard #bestdashboard #dashboard #odootag #odooservices #odoonewfeatures #newappfeatures #odoodashboardapp #dynamicdashboard #odooapp #odooappstore #TopOdooApps #odooapp #odooexperience #odoodevelopment #businessdashboard #allinonedashboard #odooproducts
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...Egor Kaleynik
This case study explores how we partnered with a mid-sized U.S. healthcare SaaS provider to help them scale from a successful pilot phase to supporting over 10,000 users—while meeting strict HIPAA compliance requirements.
Faced with slow, manual testing cycles, frequent regression bugs, and looming audit risks, their growth was at risk. Their existing QA processes couldn’t keep up with the complexity of real-time biometric data handling, and earlier automation attempts had failed due to unreliable tools and fragmented workflows.
We stepped in to deliver a full QA and DevOps transformation. Our team replaced their fragile legacy tests with Testim’s self-healing automation, integrated Postman and OWASP ZAP into Jenkins pipelines for continuous API and security validation, and leveraged AWS Device Farm for real-device, region-specific compliance testing. Custom deployment scripts gave them control over rollouts without relying on heavy CI/CD infrastructure.
The result? Test cycle times were reduced from 3 days to just 8 hours, regression bugs dropped by 40%, and they passed their first HIPAA audit without issue—unlocking faster contract signings and enabling them to expand confidently. More than just a technical upgrade, this project embedded compliance into every phase of development, proving that SaaS providers in regulated industries can scale fast and stay secure.
FL Studio Producer Edition Crack 2025 Full Versiontahirabibi60507
Copy & Past Link 👉👉
http://drfiles.net/
FL Studio is a Digital Audio Workstation (DAW) software used for music production. It's developed by the Belgian company Image-Line. FL Studio allows users to create and edit music using a graphical user interface with a pattern-based music sequencer.
⭕️➡️ FOR DOWNLOAD LINK : http://drfiles.net/ ⬅️⭕️
Maxon Cinema 4D 2025 is the latest version of the Maxon's 3D software, released in September 2024, and it builds upon previous versions with new tools for procedural modeling and animation, as well as enhancements to particle, Pyro, and rigid body simulations. CG Channel also mentions that Cinema 4D 2025.2, released in April 2025, focuses on spline tools and unified simulation enhancements.
Key improvements and features of Cinema 4D 2025 include:
Procedural Modeling: New tools and workflows for creating models procedurally, including fabric weave and constellation generators.
Procedural Animation: Field Driver tag for procedural animation.
Simulation Enhancements: Improved particle, Pyro, and rigid body simulations.
Spline Tools: Enhanced spline tools for motion graphics and animation, including spline modifiers from Rocket Lasso now included for all subscribers.
Unified Simulation & Particles: Refined physics-based effects and improved particle systems.
Boolean System: Modernized boolean system for precise 3D modeling.
Particle Node Modifier: New particle node modifier for creating particle scenes.
Learning Panel: Intuitive learning panel for new users.
Redshift Integration: Maxon now includes access to the full power of Redshift rendering for all new subscriptions.
In essence, Cinema 4D 2025 is a major update that provides artists with more powerful tools and workflows for creating 3D content, particularly in the fields of motion graphics, VFX, and visualization.
Avast Premium Security Crack FREE Latest Version 2025mu394968
🌍📱👉COPY LINK & PASTE ON GOOGLE https://dr-kain-geera.info/👈🌍
Avast Premium Security is a paid subscription service that provides comprehensive online security and privacy protection for multiple devices. It includes features like antivirus, firewall, ransomware protection, and website scanning, all designed to safeguard against a wide range of online threats, according to Avast.
Key features of Avast Premium Security:
Antivirus: Protects against viruses, malware, and other malicious software, according to Avast.
Firewall: Controls network traffic and blocks unauthorized access to your devices, as noted by All About Cookies.
Ransomware protection: Helps prevent ransomware attacks, which can encrypt your files and hold them hostage.
Website scanning: Checks websites for malicious content before you visit them, according to Avast.
Email Guardian: Scans your emails for suspicious attachments and phishing attempts.
Multi-device protection: Covers up to 10 devices, including Windows, Mac, Android, and iOS, as stated by 2GO Software.
Privacy features: Helps protect your personal data and online privacy.
In essence, Avast Premium Security provides a robust suite of tools to keep your devices and online activity safe and secure, according to Avast.
Adobe Master Collection CC Crack Advance Version 2025kashifyounis067
🌍📱👉COPY LINK & PASTE ON GOOGLE http://drfiles.net/ 👈🌍
Adobe Master Collection CC (Creative Cloud) is a comprehensive subscription-based package that bundles virtually all of Adobe's creative software applications. It provides access to a wide range of tools for graphic design, video editing, web development, photography, and more. Essentially, it's a one-stop-shop for creatives needing a broad set of professional tools.
Key Features and Benefits:
All-in-one access:
The Master Collection includes apps like Photoshop, Illustrator, InDesign, Premiere Pro, After Effects, Audition, and many others.
Subscription-based:
You pay a recurring fee for access to the latest versions of all the software, including new features and updates.
Comprehensive suite:
It offers tools for a wide variety of creative tasks, from photo editing and illustration to video editing and web development.
Cloud integration:
Creative Cloud provides cloud storage, asset sharing, and collaboration features.
Comparison to CS6:
While Adobe Creative Suite 6 (CS6) was a one-time purchase version of the software, Adobe Creative Cloud (CC) is a subscription service. CC offers access to the latest versions, regular updates, and cloud integration, while CS6 is no longer updated.
Examples of included software:
Adobe Photoshop: For image editing and manipulation.
Adobe Illustrator: For vector graphics and illustration.
Adobe InDesign: For page layout and desktop publishing.
Adobe Premiere Pro: For video editing and post-production.
Adobe After Effects: For visual effects and motion graphics.
Adobe Audition: For audio editing and mixing.
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Andre Hora
Exceptions allow developers to handle error cases expected to occur infrequently. Ideally, good test suites should test both normal and exceptional behaviors to catch more bugs and avoid regressions. While current research analyzes exceptions that propagate to tests, it does not explore other exceptions that do not reach the tests. In this paper, we provide an empirical study to explore how frequently exceptional behaviors are tested in real-world systems. We consider both exceptions that propagate to tests and the ones that do not reach the tests. For this purpose, we run an instrumented version of test suites, monitor their execution, and collect information about the exceptions raised at runtime. We analyze the test suites of 25 Python systems, covering 5,372 executed methods, 17.9M calls, and 1.4M raised exceptions. We find that 21.4% of the executed methods do raise exceptions at runtime. In methods that raise exceptions, on the median, 1 in 10 calls exercise exceptional behaviors. Close to 80% of the methods that raise exceptions do so infrequently, but about 20% raise exceptions more frequently. Finally, we provide implications for researchers and practitioners. We suggest developing novel tools to support exercising exceptional behaviors and refactoring expensive try/except blocks. We also call attention to the fact that exception-raising behaviors are not necessarily “abnormal” or rare.
Discover why Wi-Fi 7 is set to transform wireless networking and how Router Architects is leading the way with next-gen router designs built for speed, reliability, and innovation.
Societal challenges of AI: biases, multilinguism and sustainabilityJordi Cabot
Towards a fairer, inclusive and sustainable AI that works for everybody.
Reviewing the state of the art on these challenges and what we're doing at LIST to test current LLMs and help you select the one that works best for you
How can one start with crypto wallet development.pptxlaravinson24
This presentation is a beginner-friendly guide to developing a crypto wallet from scratch. It covers essential concepts such as wallet types, blockchain integration, key management, and security best practices. Ideal for developers and tech enthusiasts looking to enter the world of Web3 and decentralized finance.
How can one start with crypto wallet development.pptxlaravinson24
Java SE 8 library design
1. Java SE 8 Library Design
Using the new features well
Stephen Colebourne
Engineering Lead, OpenGamma
October 2016
2. Stephen Colebourne
● Java Champion, regular conference speaker
● Best known for date & time - Joda-Time and JSR-310
● More Joda projects - http://www.joda.org
● Major contributions in Apache Commons
● Blog - http://blog.joda.org
● Worked at OpenGamma for 6 years
3. Strata, from OpenGamma
● Open Source market risk library
● Valuation and risk calcs for finance
○ interest rate swap, FRA, CDS
● Great example of Java SE 8 coding style
http://strata.opengamma.io/
9. Lambdas
● Block of code
○ like an anonymous inner class
● Always assigned to a Functional Interface
○ an interface with one abstract method
○ Runnable, Callable, Comparator
● Uses target typing
○ context determines type of the lambda
10. // Java 7
List<Person> people = loadPeople();
Collections.sort(people, new Comparator<Person>() {
@Override
public int compare(Person p1, Person p2) {
return p1.name.compareTo(p2.name);
}
});
Lambdas
public interface Comparator<T> {
int compare(T obj1, T obj2);
}
// Java 7
Collections.sort(people, new Comparator<Person>() {
@Override
public int compare(Person p1, Person p2) {
return p1.name.compareTo(p2.name);
}
});
11. // Java 7
List<Person> people = loadPeople();
Collections.sort(people, new Comparator<Person>() {
@Override
public int compare(Person p1, Person p2) {
return p1.name.compareTo(p2.name);
}
});
Lambdas
public interface Comparator<T> {
int compare(T obj1, T obj2);
}
// Java 7
Collections.sort(people, new Comparator<Person>() {
@Override
public int compare(Person p1, Person p2) {
return p1.name.compareTo(p2.name);
}
});
12. // Java 7
List<Person> people = loadPeople();
Collections.sort(people, new Comparator<Person>() {
@Override
public int compare(Person p1, Person p2) {
return p1.name.compareTo(p2.name);
}
});
Lambdas
public interface Comparator<T> {
int compare(T obj1, T obj2);
}
// Java 8
people.sort((p1, p2) -> p1.name.compareTo(p2.name));
13. Top tips for Lambdas
● Use lambdas wherever appropriate
● Mostly, they just work
● Sometimes, the compiler needs a hint
○ use local variable
○ add the type to the lambda parameter
16. Streams
● Many loops have a similar "shape"
● Repetitive design patterns
● Stream library provides a way to abstract this
● Lambdas used to pass the interesting bits
17. Streams
List<Trade> trades = loadTrades();
List<Money> valued = new ArrayList<>();
for (Trade t : trades) {
if (t.isActive()) {
Money pv = t.presentValue();
valued.add(pv);
}
}
18. Streams
List<Trade> trades = loadTrades();
List<Money> valued = new ArrayList<>();
for (Trade t : trades) {
if (t.isActive()) {
Money pv = t.presentValue();
valued.add(pv);
}
}
20. Streams
● New stream() method on Collection
● Sequence of operations on underlying data
● Logic passed in using a lambda
○ filter() to retain/remove
○ map() to change
○ reduce() to summarise
○ sorted() to sort using a comparator
24. Exceptions in Streams
● For-each loop is a language feature
● Streams are implemented using regular methods
● Big difference in stack traces
25. Exceptions in Streams
java.lang.IllegalArgumentException: Oops
at com.opengamma.strata.calc.DefaultCalculationRunner.lambda$2(DefaultCalculationRunner.java:98)
at java.util.stream.ReferencePipeline$11$1.accept(ReferencePipeline.java:372)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at com.opengamma.strata.calc.DefaultCalculationRunner.calculate(DefaultCalculationRunner.java:100)
at com.opengamma.strata.calc.DefaultCalculationRunner.lambda$0(DefaultCalculationRunner.java:86)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at com.opengamma.strata.calc.DefaultCalculationRunner.calculate(DefaultCalculationRunner.java:87)
at com.opengamma.strata.calc.DefaultCalculationRunnerTest.calculate(DefaultCalculationRunnerTest.java:49)
Stack trace of
inner stream
Stack trace of
outer stream
26. Exceptions in Streams
java.lang.IllegalArgumentException: Oops
at com.opengamma.strata.calc.DefaultCalculationRunner.calculate(DefaultCalculationRunner.java:102)
at com.opengamma.strata.calc.DefaultCalculationRunner.calculate(DefaultCalculationRunner.java:87)
at com.opengamma.strata.calc.DefaultCalculationRunnerTest.calculate(DefaultCalculationRunnerTest.java:49)
Stack trace of
for-each loop
27. Top tips for streams
● Stream not always more readable than loop
● Stream exceptions can be much worse
● My advice:
○ use streams for small, localized, pieces of logic
○ be cautious using streams for large scale logic
● Strata uses for-each loops at top level
○ solely for shorter stack traces
29. Design with Lambdas
● Lambda is converted to a functional interface
● Normal interface with one abstract method
● Java SE 8 adds many new functional interfaces
○ Function<T, R>
○ Predicate<T>
○ Supplier<T>
○ Consumer<T>
○ see java.util.function package
● Primitive versions only for long, int, double
30. Functional interfaces
● Learn the standard functional interfaces
● Only create new ones if adding additional value
○ lots of parameters
○ mix of primitive and object parameters
○ feature really needs a good name or Javadoc
31. Functional interface example
// API functional interface
@FunctionalInterface
public interface Perturbation {
public abstract double perturb(int index, double value);
}
// API method that can be used by a lambda
public Curve perturbed(Perturbation perturbation) { … }
// caller code
curve = curve.perturbed((i, v) -> v + 1e-4);
32. Functional interface example
// API functional interface
@FunctionalInterface
public interface Perturbation {
public abstract double perturb(int index, double value);
}
// API method that can be used by a lambda
public Curve perturbed(Perturbation perturbation) { … }
// caller code
curve = curve.perturbed((i, v) -> v + 1e-4);
Name has meaning
Method signature is complex
33. Time-series example
● A time-series stores changes to a value over time
● Date-based one like Map<LocalDate, Double>
● What if you want to change the values?
34. Time-series example
// API method that can be used by a lambda
public LocalDateDoubleTimeSeries
mapValues(DoubleUnaryOperator mapper){ … }
// caller code
ts = ts.mapValues(v -> v * 2);
35. Time-series example
// API method that can be used by a lambda
public LocalDateDoubleTimeSeries
mapValues(DoubleUnaryOperator mapper){ … }
// caller code
ts = ts.mapValues(v -> v * 2);
Multiplication - no need for
multipliedBy(double)
on the API
36. Time-series example
// API method that can be used by a lambda
public LocalDateDoubleTimeSeries
mapValues(DoubleUnaryOperator mapper){ … }
// caller code
ts = ts.mapValues(v -> v * 2);
ts = ts.mapValues(v -> v / 4);
Multiplication - no need for
multipliedBy(double)
on the API
Division - no need for
dividedBy(double)
on the API
39. Abstraction
● Two or more classes with the same methods
● Abstract using an interface?
● Lambdas provide an alternative
● Consider an example with static methods
○ no way to abstract that with interfaces...
40. Abstraction
// standard API producing results
public static Money pv(FraTrade trade, Market md) { … }
public static Sens pv01(FraTrade trade, Market md) { … }
public static Double par(FraTrade trade, Market md) { … }
41. Abstraction
// standard API producing results
public static Money pv(FraTrade trade, Market md) { … }
public static Sens pv01(FraTrade trade, Market md) { … }
public static Double par(FraTrade trade, Market md) { … }
// functional interface matching all three methods
interface Calc<T> {
public abstract T invoke(FraTrade trade, Market market);
}
42. Abstraction
// create abstraction to access method by "measure" key
Map<Measure, Calc> CALCS = ImmutableMap.builder()
.put(Measures.PRESENT_VALUE, FraCalcs::pv)
.put(Measures.PV01, FraCalcs::pv01)
.put(Measures.PAR_RATE, FraCalcs:: par)
.build();
// can now invoke using measure
return CALCS.get(measure).invoke(trade, market);
43. Abstraction
● Class being abstracted was not changed
● Provides way to abstract over code you do not own
● Less need for reflection
46. Multi-threaded
● JDK provides many tools for concurrency
● Parallel streams makes it even easier
● But parallel code is not simple to get right
47. Thread problems
● What if trade modified by some other piece of code?
● Check-then-act bug
List<Trade> trades = loadTrades();
List<Money> valued =
trades.stream()
.filter(t -> t.isActive())
.map(t -> presentValue(t))
.collect(Collectors.toList());
Check
then Act
48. Immutable
● Threading bugs due to shared mutable state
● One solution is to use immutable beans
● No possibility of check-then-act type bug
49. Immutable beans
● Class should be final
○ no subclasses
● Fields must be final
○ needed for Java Memory Model
● Field types should be immutable
○ eg. don't use java.util.Date
● Factory methods and Builders instead of constructors
50. Immutable beans
● IDEs help you write mutable beans
● Need better tooling for immutable beans
○ AutoValue
○ Immutables.org
○ Joda-Beans
● Strata uses Joda-Beans
http://www.joda.org/joda-beans
51. Joda-Beans
@BeanDefinition
public final TradeInfo implements ImmutableBean {
/** The trade identifier. */
@PropertyDefinition(validate = "notNull")
private final StandardId tradeId;
/** The trade date. */
@PropertyDefinition(validate = "notNull")
private final LocalDate tradeDate;
}
52. Joda-Beans
● Source code generated for
○ getters
○ builder
○ equals/hashCode/toString
○ properties - like C#
● Can add your own code to the class and still regenerate
● Built in XML, JSON and Binary serialization
53. Immutable beans
● Most systems better using immutability everywhere
● Java SE 8 parallelStream() pushes at this
● Threading issues mostly eliminated
● No class hierarchies, use interfaces
55. Use interfaces
● Concrete classes with no hierarchies
● Interfaces provide the hierarchy
● Methods on interfaces make this practical
● All implementations of interface should be immutable
○ "Implementations must be immutable and thread-safe beans."
● Strata uses immutable beans everywhere
58. Interfaces
● Two changes to interfaces
● Default methods
○ normal method, but on an interface
○ cannot default equals/hashCode/toString
● Static methods
○ normal static method, but on an interface
59. Coding Style
● Use modifiers in interfaces
● Much clearer now there are different types of method
● Prepares for private methods in Java SE 9
public interface Foo {
public static of(String id) { … }
public abstract isEmpty();
public default isNotEmpty() { … }
}
60. Interfaces
● Methods on interfaces changes design
● Interfaces are part of macro-design
○ lambdas and streams affect micro-design
● Strata uses default and static methods liberally
61. Holiday Calendar
● Strata interface to specify which days are holidays
public interface HolidayCalendar {
// a normal abstract interface method
public abstract isHoliday(LocalDate date);
…
}
62. Holiday Calendar
● Default methods make the interface more useful
public interface HolidayCalendar {
public abstract isHoliday(LocalDate date);
// check if date is a business day
public default isBusinessDay(LocalDate date) {
return !isHoliday(date);
}
}
63. Holiday Calendar
● Default methods make the interface more useful
public interface HolidayCalendar {
public abstract isHoliday(LocalDate date);
// find the next business day
public default next(LocalDate date) {
LocalDate nextDay = date.plusDays(1);
return isHoliday(nextDay) ? next(nextDay) : nextDay;
}
}
64. Holiday Calendar
● Static methods avoid HolidayCalendarFactory
public interface HolidayCalendar {
// find holiday calendar by identifier such as DKCO
public static of(String id) {
// lookup calendar
}
}
65. Holiday Calendar
● Interface used just as would be expected
// find holiday calendar by identifier such as DKCO
HolidayCalendar cal = HolidayCalendar.of("DKCO");
// use calendar to select the trade start date
LocalDate startDate = cal.next(tradeDate);
66. Interfaces
● Interface now acts as abstract class
○ Only need abstract class if need abstracted state
○ but abstracted state is generally a bad idea
● Interface can now acts as a factory
○ Not suitable for all factory use cases*
* In Strata, holiday calendars are not really fixed at startup, but it made a good example for this talk!
67. Package-scoped implementation
● Can the interface be the only public API?
● Can the implementation class be package-scoped?
● Strata uses this pattern a lot
70. Optional and null
● New class Optional added to Java 8
● Opinions are polarized
○ some think it is the saviour of the universe
○ others think it is useless
● Used pragmatically, can be very useful
71. Optional and null
● Simple concept - two states
○ present, with a value - Optional.of(foo)
○ empty - Optional.empty()
72. Optional and null
● Standard code using null
// library, returns null if not found
public Foo getValue(String key) { … }
// application code must remember to check for null
Foo foo = getValue(key);
if (foo == null) {
foo = Foo.DEFAULT; // or throw an exception
}
73. Optional and null
● Standard code using Optional
// library, returns Optional if not found
public Optional<Foo> findValue(String key) { … }
// application code
Foo foo = findValue(key).orElse(Foo.DEFAULT);
// or
Foo foo = findValue(key).orElseThrow( … );
74. Optional and null
● Important that a variable of type Optional is never null
● Prefer methods like map() and orElse()
● Minimise use of isPresent()
75. Optional
● Strata often uses set of 3-methods
public abstract Optional<T> findValue(DataId<T> id);
public default boolean containsValue(DataId<T> id) {
return findValue(id).isPresent();
}
public default T getValue(DataId<T> id) {
return findValue(id).orElseThrow(
() -> new MarketDataException());
}
76. Optional
● Optional is a class
● Some memory/performance cost to using it
● Not serializable
● Not ideal to be an instance variable
● JDK authors added it for return types
● Use in parameters often annoying for callers
● Use as return type gets best value from concept
http://blog.joda.org/2015/08/java-se-8-optional-pragmatic-approach.html
77. Optional in Strata
● Strata has no exposed nulls
● No part of the API will return null
● Optional used when something is optional
● Pragmatically, null is used within classes
80. Java SE 8 version
● Use Java SE 8 update 40 or later
○ preferably use the latest available
● Earlier versions have annoying lambda/javac issues
81. Internal JDK packages
● Java SE 9 will remove access to some JDK packages
○ sun.*
○ com.sun.*
○ com.oracle.*
● Now is the time to prepare for this
○ Avoid sun.misc.Unsafe
○ Stick to the standard JDK API
82. Parameters
● Java SE 8 can reflect on parameter names
● Avoids need for additional libraries like paranamer
● Not enabled by default, must choose to include data
83. Checked exceptions
● Checked exceptions can be made to disappear
● Helper methods can convert to runtime exceptions
Unchecked.wrap(() -> {
// any code that might throw a checked exception
// converted to a runtime exception
});
85. Summary
● Lots of good stuff in Java SE 8
● Design and coding standards change
● Lots more potential to abstract, but don't over-use
● Methods on interfaces add a lot of power
86. Key Strata design features
● Immutable data objects, using Joda-Beans
● Static methods on interfaces, package-scope impls
● Make use of new abstractions
● Beware stack traces with streams
● Pragmatic use of Optional, null never returned from API
87. Work in Finance?
● Take a look at OpenGamma Strata
○ developed from the ground up in Java 8
○ lots of good Java 8 techniques and utilities
● High quality library for market risk
○ day counts, schedules, holidays, indices
○ models and pricing for swaps, FRAs, swaptions, FX, futures…
○ open source and stable release v1.1
http://strata.opengamma.io/