This document discusses typical Java problems that are commonly seen when reviewing codebases. It begins by summarizing 10 common problems, including weak transaction handling, overuse of checked exceptions, poor exception handling and logging, cyclic dependencies between packages, and duplication of cross-cutting concerns like tracing and validation in adapter layers. For each problem, it discusses the impact and provides solutions like using declarative transactions, favoring unchecked exceptions, ensuring exceptions are logged, managing dependencies proactively, and applying aspects to address cross-cutting concerns.
Adopting Java for the Serverless world at AWS User Group PretoriaVadym Kazulkin
Java is for many years one of the most popular programming languages, but it used to have hard times in the Serverless Community. Java is known for its high cold start times and high memory footprint. For both you have to pay to the cloud providers of your choice. That's why most developers tried to avoid using Java for such use cases. But the times change: Community and cloud providers improve things steadily for Java developers. In this talk we look at the features and possibilities AWS cloud provider offers for the Java developers and look the most popular Java frameworks, like Micronaut, Quarkus and Spring (Boot) and look how (AOT compiler and GraalVM native images play a huge role) they address Serverless challenges and enable Java for broad usage in the Serverless world.
Measure and Increase Developer Productivity with Help of Serverless at AWS Co...Vadym Kazulkin
The goal of Serverless is to focus on writing the code that delivers business value and offload everything else to your trusted partners (like Cloud providers or SaaS vendors). You want to iterate quickly and today’s code quickly becomes tomorrow’s technical debt. In this talk we will show why Serverless adoption increases the developer productivity and how to measure it. We will also go through AWS Serverless architectures where you only glue together different Serverless managed services relying solely on configuration, minimizing the amount of the code written.
Adopting Java for the Serverless world at Serverless Meetup New York and BostonVadym Kazulkin
Java is for many years one of the most popular programming languages, but it used to have hard times in the Serverless Community. Java is known for its high cold start times and high memory footprint. For both you have to pay to the cloud providers of your choice. That's why most developers tried to avoid using Java for such use cases. But the times change: Community and cloud providers improve things steadily for Java developers. In this talk we look at the features and possibilities AWS cloud provider offers for the Java developers and look the most popular Java frameworks, like Micronaut, Quarkus and Spring (Boot) and look how (AOT compiler and GraalVM native images play a huge role) they address Serverless challenges and enable Java for broad usage in the Serverless world.
Amazon Simple Workflow Service (Amazon SWF) is a workflow service for building scalable, resilient applications. Whether automating business processes for finance or insurance applications, building sophisticated data analytics applications, or managing cloud infrastructure services, Amazon SWF reliably coordinates all of the processing steps within an application.
Adopting Java for the Serverless world at AWS User Group PretoriaVadym Kazulkin
Java is for many years one of the most popular programming languages, but it used to have hard times in the Serverless Community. Java is known for its high cold start times and high memory footprint. For both you have to pay to the cloud providers of your choice. That's why most developers tried to avoid using Java for such use cases. But the times change: Community and cloud providers improve things steadily for Java developers. In this talk we look at the features and possibilities AWS cloud provider offers for the Java developers and look the most popular Java frameworks, like Micronaut, Quarkus and Spring (Boot) and look how (AOT compiler and GraalVM native images play a huge role) they address Serverless challenges and enable Java for broad usage in the Serverless world.
Measure and Increase Developer Productivity with Help of Serverless at AWS Co...Vadym Kazulkin
The goal of Serverless is to focus on writing the code that delivers business value and offload everything else to your trusted partners (like Cloud providers or SaaS vendors). You want to iterate quickly and today’s code quickly becomes tomorrow’s technical debt. In this talk we will show why Serverless adoption increases the developer productivity and how to measure it. We will also go through AWS Serverless architectures where you only glue together different Serverless managed services relying solely on configuration, minimizing the amount of the code written.
Adopting Java for the Serverless world at Serverless Meetup New York and BostonVadym Kazulkin
Java is for many years one of the most popular programming languages, but it used to have hard times in the Serverless Community. Java is known for its high cold start times and high memory footprint. For both you have to pay to the cloud providers of your choice. That's why most developers tried to avoid using Java for such use cases. But the times change: Community and cloud providers improve things steadily for Java developers. In this talk we look at the features and possibilities AWS cloud provider offers for the Java developers and look the most popular Java frameworks, like Micronaut, Quarkus and Spring (Boot) and look how (AOT compiler and GraalVM native images play a huge role) they address Serverless challenges and enable Java for broad usage in the Serverless world.
Amazon Simple Workflow Service (Amazon SWF) is a workflow service for building scalable, resilient applications. Whether automating business processes for finance or insurance applications, building sophisticated data analytics applications, or managing cloud infrastructure services, Amazon SWF reliably coordinates all of the processing steps within an application.
Adopting Java for the Serverless world at Serverless Meetup SingaporeVadym Kazulkin
Java is for many years one of the most popular programming languages, but it used to have hard times in the Serverless Community. Java is known for its high cold start times and high memory footprint. For both you have to pay to the cloud providers of your choice. That's why most developers tried to avoid using Java for such use cases. But the times change: Community and cloud providers improve things steadily for Java developers. In this talk we look at the features and possibilities AWS cloud provider offers for the Java developers and look the most popular Java frameworks, like Micronaut, Quarkus and Spring (Boot) and look how (AOT compiler and GraalVM native images play a huge role) they address Serverless challenges and enable Java for broad usage in the Serverless world.
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...Vadym Kazulkin
When we talk about prices, we often only talk about Lambda costs. In our applications, however, we rarely use only Lambda. Usually we have other building blocks like API Gateway, data sources like SNS, SQS or Kinesis. We also store our data either in S3 or in serverless databases like DynamoDB or recently in Aurora Serverless. All of these AWS services have their own pricing models to look out for. In this talk, we will draw a complete picture of the total cost of ownership in serverless applications and present a decision-making list for determining if and whether to rely on serverless paradigm in your project. In doing so, we look at the cost aspects as well as other aspects such as understanding application lifecycle, software architecture, platform limitations, organizational knowledge and plattform and tooling maturity. We will also discuss current challenges adopting serverless such as lack of high latency ephemeral storage, unsufficient network performance and missing security features.
Writing less code with Serverless on AWS at FrOSCon 2021Vadym Kazulkin
The purpose of Serverless is to focus on writing the code that delivers business value and offload undifferentiated heavy lifting to the Cloud providers or SaaS vendors of your choice. Today’s code quickly becomes tomorrow’s technical debt even if you meet the perfect decision. The less you own, the better it is from the maintainability point of view. In this talk I will go through examples of the various Serverless architectures on AWS where you glue together different Serverless managed services relying mostly on configuration, significantly reducing the amount of the code written to perform the task. Own less, build more!
JVM Support for Multitenant Applications - Steve Poole (IBM)jaxLondonConference
Presented at JAX London 2013
Per-tenant resource management can help ensure that collocated tenants peacefully share computational resources based on individual quotas. This session begins with a comparison of deployment models (shared: hardware, OS, middleware, everything) to motivate the multitenant approach. The main topic is an exploration of experimental data isolation and resource management primitives in IBM’s JDK that combine to help make multitenant applications smaller and more predictable.
Immutable Infrastructure: the new App DeploymentAxel Fontaine
Immutable Infrastructure: the new App Deployment
App deployment and server setup are complex, error-prone and time-consuming. They require OS installers, package managers, configuration recipes, install and deployment scripts, server tuning, hardening and more. But... Is this really necessary? Are we trapped in a mindset of doing things this way just because that's how they've always done?
What if we could start over and radically simplify all this? What if, within seconds, and with a single command, we could wrap our application into the bare minimal machine required to run it? What if this machine could then be transported and run unchanged on our laptop and in the cloud? How do the various platforms and tools like AWS, Docker, Heroku and Boxfuse fit into this picture? What are their strengths and weaknesses? When should you use them?
This talk is for developers and architects wishing to radically improve and simplify how they deploy their applications. It takes Continuous Delivery to a level far beyond what you've seen today. Welcome to Immutable Infrastructure generation. This is the new black.
Whizlabs webinar - Deploying Portfolio Site with AWS ServerlessDhaval Nagar
In this session, we go through the AWS Serverless eco-system and demo of how to deploy a static site using the following services.
Serverless Framework
Route53
AWS Certification Manager
S3
CloudFront
API Gateway
DynamoDB
SNS
Writing less code with Serverless on AWS at AWS User Group NairobiVadym Kazulkin
The purpose of Serverless is to focus on writing the code that delivers business value and offload undifferentiated heavy lifting to the Cloud providers or SaaS vendors of your choice. Today’s code quickly becomes tomorrow’s technical debt even if you meet the perfect decision. The less you own, the better it is from the maintainability point of view. In this talk I will go through examples of the various Serverless architectures on AWS where you glue together different Serverless managed services relying mostly on configuration, significantly reducing the amount of the code written to perform the task. Own less, build more!
Managing the deployment of code to multiple AWS Lambda functions and updating your API Gateway methods can be manual and time consuming.
In this session, we will show you how to build a deployment pipeline to AWS Lambda using AWS CodePipeline, a continuous delivery service based on Amazon’s internal release automation tooling. We will discuss how to use versioning, which enables you to better manage the different variations of your Lambda functions and API Gateway methods in your development workflow (e.g., development, staging, and production). We will walk through how to automate the entire release process of your application from development, to staging, and finally to production; performing automated integration tests at each stage.
Amazon Simple Workflow Service is a managed workflow service for building scalable, resilient applications. When it comes to automating business processes for financial applications, sophisticated data analytics applications, Amazon SWF reliably coordinates all of the processing within an application.
10 Typical Problems in Enterprise Java ApplicationsEberhard Wolff
This presentation shows some typical problems that you will find in far too many Enterprise Java Applications. It is the result of quite a few code reviews I did as a consultant.
Adopting Java for the Serverless world at Serverless Meetup SingaporeVadym Kazulkin
Java is for many years one of the most popular programming languages, but it used to have hard times in the Serverless Community. Java is known for its high cold start times and high memory footprint. For both you have to pay to the cloud providers of your choice. That's why most developers tried to avoid using Java for such use cases. But the times change: Community and cloud providers improve things steadily for Java developers. In this talk we look at the features and possibilities AWS cloud provider offers for the Java developers and look the most popular Java frameworks, like Micronaut, Quarkus and Spring (Boot) and look how (AOT compiler and GraalVM native images play a huge role) they address Serverless challenges and enable Java for broad usage in the Serverless world.
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...Vadym Kazulkin
When we talk about prices, we often only talk about Lambda costs. In our applications, however, we rarely use only Lambda. Usually we have other building blocks like API Gateway, data sources like SNS, SQS or Kinesis. We also store our data either in S3 or in serverless databases like DynamoDB or recently in Aurora Serverless. All of these AWS services have their own pricing models to look out for. In this talk, we will draw a complete picture of the total cost of ownership in serverless applications and present a decision-making list for determining if and whether to rely on serverless paradigm in your project. In doing so, we look at the cost aspects as well as other aspects such as understanding application lifecycle, software architecture, platform limitations, organizational knowledge and plattform and tooling maturity. We will also discuss current challenges adopting serverless such as lack of high latency ephemeral storage, unsufficient network performance and missing security features.
Writing less code with Serverless on AWS at FrOSCon 2021Vadym Kazulkin
The purpose of Serverless is to focus on writing the code that delivers business value and offload undifferentiated heavy lifting to the Cloud providers or SaaS vendors of your choice. Today’s code quickly becomes tomorrow’s technical debt even if you meet the perfect decision. The less you own, the better it is from the maintainability point of view. In this talk I will go through examples of the various Serverless architectures on AWS where you glue together different Serverless managed services relying mostly on configuration, significantly reducing the amount of the code written to perform the task. Own less, build more!
JVM Support for Multitenant Applications - Steve Poole (IBM)jaxLondonConference
Presented at JAX London 2013
Per-tenant resource management can help ensure that collocated tenants peacefully share computational resources based on individual quotas. This session begins with a comparison of deployment models (shared: hardware, OS, middleware, everything) to motivate the multitenant approach. The main topic is an exploration of experimental data isolation and resource management primitives in IBM’s JDK that combine to help make multitenant applications smaller and more predictable.
Immutable Infrastructure: the new App DeploymentAxel Fontaine
Immutable Infrastructure: the new App Deployment
App deployment and server setup are complex, error-prone and time-consuming. They require OS installers, package managers, configuration recipes, install and deployment scripts, server tuning, hardening and more. But... Is this really necessary? Are we trapped in a mindset of doing things this way just because that's how they've always done?
What if we could start over and radically simplify all this? What if, within seconds, and with a single command, we could wrap our application into the bare minimal machine required to run it? What if this machine could then be transported and run unchanged on our laptop and in the cloud? How do the various platforms and tools like AWS, Docker, Heroku and Boxfuse fit into this picture? What are their strengths and weaknesses? When should you use them?
This talk is for developers and architects wishing to radically improve and simplify how they deploy their applications. It takes Continuous Delivery to a level far beyond what you've seen today. Welcome to Immutable Infrastructure generation. This is the new black.
Whizlabs webinar - Deploying Portfolio Site with AWS ServerlessDhaval Nagar
In this session, we go through the AWS Serverless eco-system and demo of how to deploy a static site using the following services.
Serverless Framework
Route53
AWS Certification Manager
S3
CloudFront
API Gateway
DynamoDB
SNS
Writing less code with Serverless on AWS at AWS User Group NairobiVadym Kazulkin
The purpose of Serverless is to focus on writing the code that delivers business value and offload undifferentiated heavy lifting to the Cloud providers or SaaS vendors of your choice. Today’s code quickly becomes tomorrow’s technical debt even if you meet the perfect decision. The less you own, the better it is from the maintainability point of view. In this talk I will go through examples of the various Serverless architectures on AWS where you glue together different Serverless managed services relying mostly on configuration, significantly reducing the amount of the code written to perform the task. Own less, build more!
Managing the deployment of code to multiple AWS Lambda functions and updating your API Gateway methods can be manual and time consuming.
In this session, we will show you how to build a deployment pipeline to AWS Lambda using AWS CodePipeline, a continuous delivery service based on Amazon’s internal release automation tooling. We will discuss how to use versioning, which enables you to better manage the different variations of your Lambda functions and API Gateway methods in your development workflow (e.g., development, staging, and production). We will walk through how to automate the entire release process of your application from development, to staging, and finally to production; performing automated integration tests at each stage.
Amazon Simple Workflow Service is a managed workflow service for building scalable, resilient applications. When it comes to automating business processes for financial applications, sophisticated data analytics applications, Amazon SWF reliably coordinates all of the processing within an application.
10 Typical Problems in Enterprise Java ApplicationsEberhard Wolff
This presentation shows some typical problems that you will find in far too many Enterprise Java Applications. It is the result of quite a few code reviews I did as a consultant.
Since these presentations were spare time hobby - I've decided to share them :)
Hopefully someone will find them useful.
This part continues 1. part with more design patterns like Command, State, NullObject.
Every software developer knows object oriented programming; in fact most use it every day. Using OOP enables code reuse and creates readable and maintainable code.
But there are places where object oriented is just not enough. There are features that cut across the entire system such as security, logging and transaction handling which are hard to implement efficiently using the OO paradigm.
Aspect Oriented Programming (AOP) helps us deal with these application-wide concerns by adding a high level of reuse to the traditional OOP framework.
In this session I'll explain what AOP is all about and how it can be implemented in .NET using simple methods and industrial grade frameworks to improve the developer's everyday work by using aspects.
Shazam is a very popular audio recognition app. It is installed on 100M+ Android devices and it’s growing rapidly. In this talk, we will address how we made the release schedule faster, more predictable and with more features by using BDD and automation testing.
We’ll demonstrate how that can be done without slowing down or hindering the development process and why our developers actually find writing tests is fun. Finally, we’ll look at how our testing strategy has translated to our testing framework and hardware infrastructure.
A case study of the changes and transition from ZF1 to ZF2 in the Zend Server UI project in Webinar form: http://www.zend.com/en/webinar/Framework/70170000000bwxn-ZSVR6UI-ZF2-20130129.flv
Testing Eclipse GUIs still is an elaborate and extensive task. There are two ways to get the task done: Record-and-play and programming by hand. Test-first programmers usually prefer to program their tests by hand instead of using record-and-play tools, which are typically used by test departments that construct large functional test suites.
When programming UI tests by hand, the programmer is let alone mainly with SWT Robots. While they are great tools to find and use widgets, they naturally can't find their controllers like the the JFace Viewers and the Workbench ViewParts. In test-first development this becomes a problem because the programming level for test and productive code is at a different abstraction level.
Matthias Kempka has found a way to implement a JFace/Workbench Robot. It finds JFace Viewers for SWT elements and eases the testing with views and editors. Declarative UI Elements become accessible for programmed tests. In his talk Matthias Kempka shows how he uses the JFace/Workbench Robot to develop GUI components in Eclipse test-driven and gives an introduction to the key ideas that make the Robot work.
Exception handling - Fundamentals of exception handling, Exception types, Termination or resumptive models, Uncaught exceptions, using try and catch, multiple catch clauses, nested try statements, throw, throws and finally, built- in exceptions, creating own exception sub classes.
Multithreading- Differences between thread-based multitasking and process-based multitasking, Java thread model, creating threads, thread priorities, synchronizing threads, inter thread communication
Stopping the Rot - Putting Legacy C++ Under TestSeb Rose
Presentation given at the ACCU 2011 Conference in Oxford, UK.
Case study of applying unit test to the DOORS codebase. Includes a quick overview of unit test & the Google Test and Mock libraries. Also 3 specific refactoring examples shown.
How Testability Inspires AngularJS Design / Ran MizrahiRan Mizrahi
Testability is a major part of design decision making in Angular`s development.
In this sessions we’ll cover what testability is, how it inspires Angular`s design and why it’s good for us.
Limiting software architecture to the traditional ideas is not enough for today's challenges. This presentation shows additional tools and how problems like maintainability, reliability and usability can be solved.
Continuous Delivery solves many current challenges - but still adoption is limited. This talks shows reasons for this and how to overcome these problems.
Four Times Microservices - REST, Kubernetes, UI Integration, AsyncEberhard Wolff
How you can build microservices:
- REST with the Netflix stack (Eureka for Service Discovery, Ribbon for Load Balancing, Hystrix for Resilience, Zuul for Routing)
- REST with Consul for Services Discovery
- REST with Kubernetes
- UI integration with ESI (Edge Side Includes)
- UI integration on the client with JavaScript
- Async with Apache Kafka
- Async with HTTP + Atom
This presentation show several options how to implement microservices: the Netflix stack, Consul, and Kubernetes. Also integration options like REST and UI integration are covered.
There are many different deployment options - package managers, tools like Chef or Puppet, PaaS and orchestration tools. This presentation give an overview of these tools and approaches like idempotent installation or immutable server.
Held at Continuous Lifecycle 2016
How to Split Your System into MicroservicesEberhard Wolff
Splitting a system into microservices is a challenging task. This talk shows how ideas like Bounded Context, migration scenarios and technical constraints can be used to build a microservice architecture. Held at WJAX 2016.
Microservices and Self-contained System to Scale AgileEberhard Wolff
Architectures like Microservices and Self-contained Systems provide a way to support agile processes and scale them. Held at JUG Saxony Day 2016 in Dresden.
Data Architecturen Not Just for MicroservicesEberhard Wolff
Microservices change the way data is handled and stored. This presentation shows how Bounded Context, Events, Event Sourcing and CQRS provide new approaches to handle data.
We assume software should contain no redundancies and that a clean architecture is the way to a maintainable system. Microservices challenge these assumptions. Keynote from Entwicklertage 2016 in Karlsruhe.
Nanoservices are smaller than Microservices. This presentation shows how technologies like Amazon Lambda, OSGi and Java EE can be used to enable such small services.
Microservices: Architecture to scale AgileEberhard Wolff
Microservices allow for scaling agile processes. This presentation shows what Microservices are, what agility is and introduces Self-contained Systems (SCS). Finally, it shows how SCS can help to scale agile processes.
Microservices, DevOps, Continuous Delivery – More Than Three BuzzwordsEberhard Wolff
Microservices, DevOps and Continuous Delivery are three hypes at the moment. This talk looks into the relationships between these three approaches and gives an idea how these approaches help to solve concrete problems. Held at Continuous Lifecycle 2015.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
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!
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
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/
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/
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
UiPath Test Automation using UiPath Test Suite series, part 3
10 Typical Java Problems in the Wild
1. Typical Java Problems
in the Wild
Eberhard Wolff
SpringSource
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
2. SpringSource Solution
Unifying the Application Lifecycle:
from Developer to Datacenter
High Productivity Tools Lean Powerful Runtimes
Spring Enterprise SpringSource tc Server
Groovy and Grails Build
Run
SpringSource dm Server
SpringSource Tool Suite SpringSource http Server
Manage
Application Infrastructure Management
SpringSource Hyperic HQ
SpringSource Hyperic IQ
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 2
3. About me
• Regional Director German speaking region and
Principal Consultant
• Author of several articles and books
• First German Spring book
• Speaker at national and international conferences
• Eberhard.Wolff@springsource.com
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 3
4. Why this talk?
• I do a lot of reviews
• There are some common problems you see over and
over again
• So: Here are 10
– …not necessarily the most common
– ...but certainly with severe effects
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 4
5. #1
public class Service {
private CustomerDao customerDao;
private PlatformTransactionManager transactionManager;
public void performSomeService() {
TransactionStatus transactionStatus = transactionManager
.getTransaction(new DefaultTransactionDefinition());
customerDao.doSomething();
customerDao.doSomethingElse();
transactionManager.commit(transactionStatus);
}
}
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 5
6. #1 Weak Transaction
Handling
public class Service {
private CustomerDao customerDao;
private PlatformTransactionManager transactionManager;
public void performSomeService() {
TransactionStatus transactionStatus = transactionManager
.getTransaction(new DefaultTransactionDefinition());
customerDao.doSomething();
customerDao.doSomethingElse();
transactionManager.commit(transactionStatus);
}
• What happens to the transaction if the DAO
}
throws an exception?
• We might never learn...
• ...or learn the hard way
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 6
7. Weak Transaction Handling:
Impact
• Hard to detect, has effects only if exception is
thrown
• …but then it can lead to wired behavior and data loss
etc.
• That is why you are using transactions in the first
place
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 7
8. Solution
• Declarative transactions
public class Service {
private CustomerDao customerDao;
@Transactional
public void performSomeService() {
customerDao.doSomething();
customerDao.doSomethingElse();
}
}
• Exception is caught, transaction is rolled back (if
it is a RuntimeException)
• Exception handling can be customized
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 8
9. A different solution…
public void performSomeService() {
TransactionTemplate template = new TransactionTemplate(
transactionManager);
template.execute(new TransactionCallback() {
public Object doInTransaction(TransactionStatus status) {
customerDao.doSomething();
customerDao.doSomethingElse();
return null;
}
});
}
• Allows for multiple transactions in one method
• More code – more control
• Rather seldom really needed
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 9
10. #2 Exception Design
• Get all the details from a system exception!
• Each layer must only use its own exceptions!
• Exceptions have to be checked – then they must be
handled and the code is more secure.
• Sounds reasonably, doesn't it?
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 10
11. public class OrderDao {
public void createOrder(Order order) throws SQLException {
// some ugly JDBC code
// that I am not going to show
}
}
public class SomeService {
public void performService()
Get all the details! throws ServiceException {
Use checked try {
exceptions! orderDao.createOrder(new Order());
} catch (SQLException e) {
throw new ServiceException(e);
Service must only }
throw }
ServiceException! } public class SomeController {
public void handleWebRequest() {
try {
What am I supposed to do someService.performService();
now? } catch (Exception e) {
No real logging e.printStackTrace();
}
And I don t care about the }
specific ServiceException }
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 11
12. Impact
• Lots of useless exception handling code
• Lots of exception types without specific handling of
that type
• In the end all you get is a log entry and lots of code
• And what should the developer do?
– All he knows "Something went wrong"
– Does not really care and can not really handle it
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 12
13. Why is this commonplace?
• Very few languages have checked exceptions (Java -
CLU and Modula-3 had similar concepts)
• Checked exception force developers to handle an
exception – very rigid
• How common is it that you can really handle an
exception?
• Checked exceptions are perceived to be more secure
• Checked exceptions are overused – also in Java APIs
• In many cases there are even no exception concepts
in projects
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 13
14. Solution
• Use more unchecked exceptions aka
RuntimeExceptions
• Remember: A lot of languages offer only unchecked
exceptions
• Avoid wrap-and-rethrow – it does not add value
• Don't write too many exception classes – they often
don't add value
• A specific exception classes is only useful if that
exception should be handled differently
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 14
15. Solution
public class OrderDao {
public void createOrder(Order order) {
jdbcTemplate.update("INSERT INTO ORDER ...");
}
}
public class SomeService {
Where is the public void performService() {
exception }
orderDao.createOrder(new Order());
handling? }
public class SomeController {
public void handleWebRequest() {
someService.performService();
}
}
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 15
16. AOP in one Slide
@Aspect
public class AnAspect {
// do something before the method hello
// is executed
@Before("execution(void hello())")
public void doSomething() {
}
// in a specific class
// that ends in Service in any package or subpackage
@Before("execution(* com.springsource.MyService.hello())")
public void doSomethingElse2() {
}
// do something before any method in a class
// that ends in Service in any package or subpackage
@Before("execution(* *..*Service.*(..))")
public void doSomethingElse2() {
} 16
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
17. Aspect for Logging
@Aspect
public class ExceptionLogging {
@AfterThrowing(value="execution(* *..Service*.*(..))",
throwing="ex")
public void logRuntimeException(RuntimeException ex) {
System.out.println(ex);
}
}
• Logs every exception – 100% guaranteed!
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 17
18. Handle only cases you really
want to handle
public class SomeService {
public void performService() {
try {
orderDao.createOrder(new Order());
} catch (OptimisticLockingFailureException ex) {
orderDao.createOrder(new Order());
}
}
}
• Everything else will be handled somewhere else
• Can handle specific error conditions using catch with
specific types
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 18
19. Generic Exception Handling
public class MyHandlerExceptionResolver
implements HandlerExceptionResolver {
public ModelAndView resolveException(
HttpServletRequest request,
HttpServletResponse response, Object handler, Exception ex) {
return new ModelAndView("exceptionView", "exception", ex);
}
}
• In the web layer
• Handle all the (Runtime)Exceptions not handled
elsewhere
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 19
20. #3 Exception Handling
public void someMethod() {
try {
} catch (Exception ex) { Exception is not logged
ex.printStackTrace(); just written to stdout
}
operations might not notice
try {
} catch (Exception ex) {
// should never happen Exception is swallowed
}
}
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 20
21. Impact
• Related to #2: If you have excessive checked
exceptions this will occur more often
• …as developers are forced to handle exceptions they
can't really handle
• In the end you just get a message on the console
and the application continues.
• All kinds of wired behavior
• i.e. exception is swallowed
• You will have a hard time finding problems in the
code
• Potentially a huge problem – so worth its own
explanation
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 21
22. Solution
• At least log exceptions
• Rethink: Is it really OK to continue in this situation?
If not - don't handle the exception. Might be better
to let a generic handler handle it.
• Introduce generic handling at least for
RuntimeException (AOP, web front end, etc)
• Enforce the logging using Findbugs, PMD etc.
• And: Improve the
public void someMethod() {
exception design (#2) try {
} catch (Exception ex) {
log.error(ex);
}
}
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 22
23. #4
• Table of
packages and
the relations
between them
• Everything in
red is part of a
cycle
• This is actual
code from an
Open Source
project
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 23
25. Dependency
Graph
• Just a small part
• Red line show
circular references
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 25
26. What is Architecture?
• Architecture is the decomposition of systems in parts
• No large or complex parts
• No cyclic dependencies
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 26
27. Normal Dependencies
• B dependes on A, i.e. it uses
classe, methods etc.
• Changes in A impact B Component A
• Changes in B do not impact A
Component B
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 27
28. Cyclic Dependency
• B depends on A and A on B
• Changes in A impact B
• Changes in B impact A Component A
• A and B can only be changed
as one unit
• …even though they should be
two separate units
Component B
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 28
29. Bigger cyclic dependencies
Component A
Component B
Component C
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 29
30. #4: Architecture Mess
• This is effectively
just one big
unstructured pile
of mud
• Maintenance will
be hard
• Concurrent
development will
be hard
• Changes will have
unforeseeable
results
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 30
31. Solution
• Very hard if you have this state
• Therefore: Manage dependencies from the start
• Otherwise you are looking at a major restructuring of
your application
• …which might not be worth it
• Effort for restructuring pays off by lower effort for
maintenance
• …might take a long time to amortize
• Throwing away + redevelopment means that you
have to migrate to a new solution -> complex and
risky
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 31
32. #5
public class ServiceAdaptor {
public void performService(OrderDTO orderDTO) {
logger.trace("Entering performService");
try {
if (orderDTO == null) {
throw new NullPointerException("order must not be null");
}
if (youAreNotAllowedToDoThis()) {
throw new IllegalStateException(
"You are not allowed to call this!");
}
OrderEntity order = new OrderEntity();
order.setCustomer(orderDTO.getCustomer()); // ...
service.performService(order);
commandLog.add(new Command("performService",
service,order));
} finally {
logger.trace("Leaving performanceService");
}
}
} 32
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
33. #5: Adaptor Layer
• Adds to a service:
– Security
– Tracing
– Check for null arguments
– Log for all commands (auditing, replay…)
– Conversion from DTO to internal representation
• Lots of boilerplate for each service
• Changes to tracing etc. hard: lots of methods to
change
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 33
34. Solution: Tracing with AOP
• …or use Spring's predefined TraceInterceptor,
DebugInterceptor etc.
@Aspect
public class TraceAspect {
@Before("execution(* *..*Service.*(..))")
public void traceBegin(JoinPoint joinPoint) {
System.out.println("entering method "
+ joinPoint.getSignature().getName());
}
@After("execution(* *..*Service.*(..))")
public void traceEnd(JoinPoint joinPoint) {
System.out.println("leaving method "
+ joinPoint.getSignature().getName());
}
}
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 34
35. Solution:
Null Checks with AOP
@Aspect
public class NullChecker {
@Before("execution(* *..*Service.*(..))")
public void checkForNull(JoinPoint joinPoint) {
for (Object arg : joinPoint.getArgs()) {
if (arg==null) {
throw new NullPointerException("Argument was null!");
}
}
}
}
• Security can be handled with Spring Security or AOP
• Command log also possible
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 35
36. What is left…
public class ServiceAdaptor {
public void performService(OrderDTO orderDTO) {
OrderEntity order = new OrderEntity();
order.setCustomer(orderDTO.getCustomer()); // ...
service.performService(order);
}
}
• You should probably switch to Dozer
• http://dozer.sf.net
• Can externalize mapping rules
• i.e. the layer can be more or less eliminated
• Everything (mapping, security, tracing…) is now
implemented in one place (DRY)
• Often services just delegate to DAOs –
same issue
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 36
37. #6: No DAO
public class SomeService {
@PersistenceContext
private EntityManager entityManager;
public void performSomeService() {
List<Order> list = entityManager.
createQuery("select o from Order").getResultList();
for (Order o : list) {
// ...
if (o.shouldBeProcessed()) {
o.process();
}
}
}
}
• We don't need to abstract away from JPA – it's a
standard, right?
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 37
38. #6: Even worse
public class SomeServiceJdbc {
private OrderDao someDoa;
public void performSomeService() throws SQLException {
ResultSet rs = someDoa.getOrders();
while (rs.next()) {
//...
}
}
}
• Service depends on JDBC
• …and throws SQLException
• Persistence visible in the service layer and beyond
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 38
39. Impact
• Code is impossible to test without a database
• …so no real unit tests possible
• Service depends on persistence – cannot be ported
• How do you add data dependent security?
• No structure
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 39
40. Solution
• Use a DAO (Data Access Object)
– Separate persistence layer
– Technical motivation
• …or a Repository
– Interface to existing objects
– Non technical motivation: Domain Driven Design, Eric
Evans
• Basically the same thing
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 40
41. Solution
public class SomeServiceDAO {
public void performSomeService() {
List<Order> list = orderDao.getAllOrders();
for (Order o : list) {
// ...
if (o.shouldBeProcessed()) {
o.process();
}
}
}
}
• Clear separation
• Tests easy
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 41
42. Solution: Test
public class ServiceTest {
@Test
public void testService() {
SomeService someService = new SomeService();
someService.setOrderDao(new OrderDao() {
public List<Order> getAllOrders() {
List<Order> result = new ArrayList<Order>();
return result;
}
});
someService.performSomeService();
Assert.assertEquals(expected, result);
}
}
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 42
43. #7
• No Tests
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 43
44. #7 Or bad tests
• No asserts public class MyUnitTest {
private Service service = new Service();
• System.out:
results are @Test
checked public void testService() {
manually Order order = new Order();
service.performService(order);
• Tests commented System.out.print(order.isProcessed());
out: They did not }
run any more
and were not // @Test
// public void testOrderCreated() {
fixed // Order order = new Order();
• No mocks, so no // service.createOrder(order);
real Unit Tests // }
• No negative }
cases
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 44
45. Impact
• Code is not properly tested
• Probably low quality – testable code is usually better
designed
• Code is hard to change: How can you know the
change broke nothing?
• Design might be bad: Testable usually mean better
quality
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 45
46. Solution
• Write proper Unit Tests!
public class MyProperUnitTest {
private Service service = new Service();
@Test
public void testService() {
Order order = new Order();
service.performService(order);
Assert.assertTrue(order.isProcessed());
}
@Test(expected=IllegalArgumentException.class)
public void testServiceException() {
Order order = new BuggyOrder();
service.performService(order);
}
}
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 46
47. Wow, that was easy!
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
48. The real problem…
• The idea of Unit tests is over 10 years old
• Not too many programmer actually do real unit tests
• Even though it should greatly increased trust and
confidence in your code
• …and make you much more relaxed and therefore
improve quality of life…
• Original paper: Gamma, Beck: "Test Infected –
Programmers Love Writing Tests"
• Yeah, right.
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 48
50. Solution
• Educate
– Show how to write Unit Test
– Show how to build Mocks
– Show aggressive Testing
– Show Test First / Test Driven Development
• Coach / Review
• Integrate in automatic build
• Later on: Add integration testing, functional testing,
FIT, Fitnesse etc.
• …or even start with these
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 50
51. What does not really work
• Measuring code coverage
– Can be sabotaged
public class MyProperUnitTest {
private Service service = new Service();
@Test
public void testService() {
Order order = new Order();
service.performService(order);
}
}
• Let developers just write tests without education
– How should they know how to test properly?
– Test driven development is not obvious
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 51
52. #8: Creating SQL statements
public class OrderDAO {
private SimpleJdbcTemplate simpleJdbcTemplate;
public List<Order> findOrderByCustomer(String customer) {
return simpleJdbcTemplate.query(
"SELECT * FROM T_ORDER WHERE name='"
+ customer + "'", new OrderRowMapper());
}
}
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 52
53. Impact
• Performance is bad:
– Statement is parsed every time
– Execution plan is re created etc.
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 53
54. Impact
• Even worse: SQL injection
• Pass in a' or 't'='t'
• Better yet: a'; DROP TABLE T_ORDER; SELECT *
FROM ANOTHER_TABLE
public class OrderDAO {
private SimpleJdbcTemplate simpleJdbcTemplate;
public List<Order> findOrderByCustomer(String customer) {
return simpleJdbcTemplate.query(
"SELECT * FROM T_ORDER WHERE name='"
+ customer + "'", new OrderRowMapper());
}
}
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 54
55. Solution
public class OrderDAO {
private SimpleJdbcTemplate simpleJdbcTemplate;
public List<Order> findOrderByCustomer(String customer) {
return simpleJdbcTemplate.query(
"SELECT * FROM T_ORDER WHERE name=?",
new OrderRowMapper(), customer);
}
}
• … and white list the allowed characters in name
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 55
56. #9
• "What about Performance?"
• "Well, we figured the response time should be 2s."
• "How many request do you expect?"
• "…"
• "What kind of requests do you expect?"
• "..."
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 56
57. #9
• The software is happily in the final functional test
• Then the performance test start
• Performance is too bad to be accepted
• You can hardly do anything:
– Changes might introduce functional errors
– Too late for bigger changes anyway
• The results might be wrong if the performance test is
on different hardware than production.
• You can't test on production hardware: Too
expensive.
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 57
58. Impact
• You have to get bigger hardware
– Prerequisite: The software is scalable
• Worse: You can't go into production
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 58
59. Solution
• Get information about the number of requests,
expected types of requests, acceptable response
times
• Pro active performance management:
– Estimate the performance before implementation
– …by estimating the slow operations (access to other
systems, to the database etc)
– Measure performance of these operation in production
• Practice performance measurements and
optimizations before performance test
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 59
60. #10
public class SomeService {
private Map cache = new HashMap();
private Customer customer;
public Order performService(int i) {
if (cache.containsKey(i)) {
return cache.get(i);
}
Order result;
customer = null;
cache.put(i, result);
return result;
}
}
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 60
61. #10 Multiple threads, memory
leaks
public class SomeService {
The cache is filled –
private Map<Integer,Order> cache = is it ever emptied?
new HashMap<Integer, Order>();
private Customer customer; HashMap is not
public Order performService(int i) {
threadsafe
if (cache.containsKey(i)) {
return (Ordercache.get(i);
customer is an
} instance variable –
Order result; multi threading will
customer = null;
...
be a problem
cache.put(i, result);
return result;
}
}
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 61
62. Impact
• System working in small tests
• In particular Unit tests work
• But production fails
• …probably hard to analyze / fix
• Almost only by code reviews
• …or extensive debugging using thread dumps
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 62
63. Solution
public class SomeServiceSolution {
• Use WeakHashMap to
avoid memory leaks private Map<Integer, Order> cache =
new WeakHashMap<Integer, Order>();
• Synchronize
• Prefer local variables public Order performService(int i) {
synchronized (cache) {
• Usually services can if (cache.containsKey(i)) {
store most things in return cache.get(i);
}
local variables }
Order result = null;
Customer customer = null;
synchronized (cache) {
cache.put(i, result);
}
return result;
}
}
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 63
64. Solution
• Also consider ConcurrentHashMap
• or http://sourceforge.net/projects/high-scale-lib
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 64
65. Sum Up
• #1 Weak Transaction • #8 Creating SQL
Handling queries using String
• #2 Exception Design concatenation
• #3 Exception Handling • #9 No performance
• #4 Architecture Mess management
• #10 Multiple threads /
• #5 Adaptor Layer
memory leaks
• #6 No DAO
• #7 No or bad tests
Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 65