Monads and Monoids: from daily java to Big Data analytics in Scala
Finally, after two decades of evolution, Java 8 made a step towards functional programming. What can Java learn from other mature functional languages? How to leverage obscure mathematical abstractions such as Monad or Monoid in practice? Usually people find it scary and difficult to understand. Oleksiy will explain these concepts in simple words to give a feeling of powerful tool applicable in many domains, from daily Java and Scala routines to Big Data analytics with Storm or Hadoop.
Beginning Haskell, Dive In, Its Not That Scary!priort
Haskell can get a bit of a reputation for being this lofty, academic, difficult to learn language. This talk aims to dispel this myth and offer an introduction to this beautiful and pragmatic language. From the point of view of someone who has been functional programming in Scala and Clojure for a while now, but who has, more recently been taking a dive into Haskell, this talk will give a basic introduction to Haskell. Hopefully it will encourage anyone who hasn't tried functional programming in Haskell to dive in too and give it a go.
The talk will be a whistle stop tour of some functional programming fundamentals in Haskell from basic data structures, logic constructs, functional transformations, recursion to some of the basics of Haskell's type system with data declarations and type classes.
Slideshare hasn't imported my notes, so here's the link to the Google Presentation: https://goo.gl/Gl4Vhm
Haskell is a statically typed, non strict, pure functional programming language. It is often talked and blogged about, but rarely used commercially. This talk starts with a brief overview of the language, then explains how Haskell is evaluated and how it deals with non-determinism and side effects using only pure functions. The suitability of Haskell for real world data science is then discussed, along with some examples of its users, a small Haskell-powered visualization, and an overview of useful packages for data science. Finally, Accelerate is introduced, an embedded DSL for array computations on the GPU, and an ongoing attempt to use it as the basis for a deep learning package.
Special Edition with Dr. Robin Bloor
Live Webcast September 9, 2015
Watch the Archive: https://bloorgroup.webex.com/bloorgroup/onstage/g.php?MTID=e8b9ac35d8e4ffa3452562c1d4286a975
Do the math: algebra will transform information management. Just as the relational database revolutionized the information landscape, so will a just-released, complete algebra of data overhaul the industry itself. So says Dr. Robin Bloor in his new book, the Algebra of Data, which he’ll outline in this special one-hour webcast.
Once organizations learn how to express their data sets algebraically, the benefits will be significant and far-reaching. Data quality problems will slowly subside; queries will run orders of magnitude faster; integration challenges will fade; and countless tedious jobs in the data management space will bid their farewell. But first, software companies must evolve, and that will take time.
Visit InsideAnalysis.com for more information.
Beginning Haskell, Dive In, Its Not That Scary!priort
Haskell can get a bit of a reputation for being this lofty, academic, difficult to learn language. This talk aims to dispel this myth and offer an introduction to this beautiful and pragmatic language. From the point of view of someone who has been functional programming in Scala and Clojure for a while now, but who has, more recently been taking a dive into Haskell, this talk will give a basic introduction to Haskell. Hopefully it will encourage anyone who hasn't tried functional programming in Haskell to dive in too and give it a go.
The talk will be a whistle stop tour of some functional programming fundamentals in Haskell from basic data structures, logic constructs, functional transformations, recursion to some of the basics of Haskell's type system with data declarations and type classes.
Slideshare hasn't imported my notes, so here's the link to the Google Presentation: https://goo.gl/Gl4Vhm
Haskell is a statically typed, non strict, pure functional programming language. It is often talked and blogged about, but rarely used commercially. This talk starts with a brief overview of the language, then explains how Haskell is evaluated and how it deals with non-determinism and side effects using only pure functions. The suitability of Haskell for real world data science is then discussed, along with some examples of its users, a small Haskell-powered visualization, and an overview of useful packages for data science. Finally, Accelerate is introduced, an embedded DSL for array computations on the GPU, and an ongoing attempt to use it as the basis for a deep learning package.
Special Edition with Dr. Robin Bloor
Live Webcast September 9, 2015
Watch the Archive: https://bloorgroup.webex.com/bloorgroup/onstage/g.php?MTID=e8b9ac35d8e4ffa3452562c1d4286a975
Do the math: algebra will transform information management. Just as the relational database revolutionized the information landscape, so will a just-released, complete algebra of data overhaul the industry itself. So says Dr. Robin Bloor in his new book, the Algebra of Data, which he’ll outline in this special one-hour webcast.
Once organizations learn how to express their data sets algebraically, the benefits will be significant and far-reaching. Data quality problems will slowly subside; queries will run orders of magnitude faster; integration challenges will fade; and countless tedious jobs in the data management space will bid their farewell. But first, software companies must evolve, and that will take time.
Visit InsideAnalysis.com for more information.
Quicksort - a whistle-stop tour of the algorithm in five languages and four p...Philip Schwarz
Quicksort - a whistle-stop tour of the algorithm in five languages and four paradigms.
Programming Paradigms: Functional, Logic, Imperative, Imperative Functional
Languages: Haskell, Scala, Java, Clojure, Prolog
This presentation is all about various built in
datastructures which we have in python.
List
Dictionary
Tuple
Set
and various methods present in each data structure
In this chapter we will analyze more complex data structures like dictionaries and sets, and their implementations with hash-tables and balanced trees. We will explain in more details what hashing and hash-tables mean and why they are such an important part of programming. We will discuss the concept of "collisions" and how they might happen when implementing hash-tables. Also we will offer you different types of approaches for solving this type of issues. We will look at the abstract data structure set and explain how it can be implemented with the ADTs dictionary and balanced search tree. Also we will provide you with examples that illustrate the behavior of these data structures with real world examples.
Talk is about simple data structures like queue and Tree and their possible implementation in Scala. It also talks about binary search trees and their traversals.
In this chapter we will discuss tree data structures, like trees and graphs. The abilities of these data structures are really important for the modern programming. Each of this data structures is used for building a model of real life problems, which are efficiently solved using this model. We will explain what tree data structures are and will review their main advantages and disadvantages. We will present example implementations and problems showing their practical usage. We will focus on binary trees, binary search trees and self-balancing binary search tree. We will explain what graph is, the types of graphs, how to represent a graph in the memory (graph implementation) and where graphs are used in our life and in the computer technologies. We will see where in .NET Framework self-balancing binary search trees are implemented and how to use them.
19. Java data structures algorithms and complexityIntro C# Book
In this chapter we will compare the data structures we have learned so far by the performance (execution speed) of the basic operations (addition, search, deletion, etc.). We will give specific tips in what situations what data structures to use.
Function Programming in Scala.
A lot of my examples here comes from the book
Functional programming in Scala By Paul Chiusano and Rúnar Bjarnason, It is a good book, buy it.
Quicksort - a whistle-stop tour of the algorithm in five languages and four p...Philip Schwarz
Quicksort - a whistle-stop tour of the algorithm in five languages and four paradigms.
Programming Paradigms: Functional, Logic, Imperative, Imperative Functional
Languages: Haskell, Scala, Java, Clojure, Prolog
This presentation is all about various built in
datastructures which we have in python.
List
Dictionary
Tuple
Set
and various methods present in each data structure
In this chapter we will analyze more complex data structures like dictionaries and sets, and their implementations with hash-tables and balanced trees. We will explain in more details what hashing and hash-tables mean and why they are such an important part of programming. We will discuss the concept of "collisions" and how they might happen when implementing hash-tables. Also we will offer you different types of approaches for solving this type of issues. We will look at the abstract data structure set and explain how it can be implemented with the ADTs dictionary and balanced search tree. Also we will provide you with examples that illustrate the behavior of these data structures with real world examples.
Talk is about simple data structures like queue and Tree and their possible implementation in Scala. It also talks about binary search trees and their traversals.
In this chapter we will discuss tree data structures, like trees and graphs. The abilities of these data structures are really important for the modern programming. Each of this data structures is used for building a model of real life problems, which are efficiently solved using this model. We will explain what tree data structures are and will review their main advantages and disadvantages. We will present example implementations and problems showing their practical usage. We will focus on binary trees, binary search trees and self-balancing binary search tree. We will explain what graph is, the types of graphs, how to represent a graph in the memory (graph implementation) and where graphs are used in our life and in the computer technologies. We will see where in .NET Framework self-balancing binary search trees are implemented and how to use them.
19. Java data structures algorithms and complexityIntro C# Book
In this chapter we will compare the data structures we have learned so far by the performance (execution speed) of the basic operations (addition, search, deletion, etc.). We will give specific tips in what situations what data structures to use.
Function Programming in Scala.
A lot of my examples here comes from the book
Functional programming in Scala By Paul Chiusano and Rúnar Bjarnason, It is a good book, buy it.
These are the outline slides that I used for the Pune Clojure Course.
The slides may not be much useful standalone, but I have uploaded them for reference.
download for better quality - Learn about the sequence and traverse functions through the work of Runar Bjarnason and Paul Chiusano, authors of Functional Programming in Scala https://www.manning.com/books/functional-programming-in-scala, and Sam Halliday, author of "Functional Programming for Mortals with Scalaz" https://leanpub.com/fpmortals
Apple's Swift has achieved the top place in Stack Overflow's "Most Loved" list of programming languages in its 2015 Developer Survey. Based on information gleaned from GitHub and Stack Overflow, analyst firm RedMonk has seen Swift's popularity ranking soar from 68 to 22 in an unprecedented 6 months.
The "Extreme Swift" event does not require advanced, or even any, knowledge of Swift. Learn about some of the more outrageous features of the language which help explain what the fuss is all about!
Never look at programming the same way again — even if you never end up writing a single line of Swift code in your life.
Science, Technology, Engineering and Mathematics, STEM, are vital to the future of our children. The parents and students in our educational systems need to understand and embrace the technology that affects them every day of their lives. Devoxx4Kids is on a global mission to complement the classical schooling system by offering workshops to kids in a fun way. and teaching them computing concepts using Scratch, Greenfoot, Minecraft, Raspberry Pi, Arduino, NAO, Tynker. We will share a path that can be followed by adults to keep kids in their vicinity engaged and build, instead of just play, games. You will learn best practices to organize similar workshops in your local setting and hear tips on opening a local chapter. This talk will be appreciated by anybody who has kids, nephews, nieces, and in general kids around them.
Writing concurrent code that is also correct is unbelievably hard. Naturally, humanity has developed a number of approaches to handle concurrency in the code, starting from basic threads that follow the hardware way to do concurrency to higher level primitives like fibers and work-stealing solutions. But which approach is the best for you? In this session, we'll take a look at a simple concurrent problem and solve it using different ways to manage concurrency: threads, executors, actors, fibers, monadic code with completable futures. All these approaches are different from the simplicity, readability, configuration and management point of view. Some scenarios are better modelled with threads, while sometimes you're better off with actors. We'll discuss the benefits of each approach and figure out when it's worth pursuing in your project.
До выхода Feature Complete версии OpenJDK 9 EA остался месяц. Самое время посмотреть, что ждет нас в следующей версии Java. Для начала рассмотрим процесс того, как идеи становятся JEP-ами, а потом становятся частью стандарта языка Java. Потом посмотрим на список из четрех десятков фич, разберем наименее тривилаьные из них на примерах: jshell, jmh, unified jvm logging и, конечно же, модулярность.
Continuously building, releasing and deploying software: The Revenge of the M...JavaDayUA
We used to release one product, once a year, built by one team. Today we have teams of hundreds of developers creating a multitude of software packages that are released multiple times a day.How did that happen?! In this talk, we’ll give you the answer: As the good old advice of Computer Science goes, “If it hurts, do it more often!”. Suddenly, we realized that what we do during the “Release Month Code Freeze” is actually a lot of repeatable, automatable steps. So, we called in the machines.Now we have Continuous Integration servers controlling an exponential amount of robot developers (agents) that are building and testing our code, all day long. Continuous Deployment tools, dictating their order to robot sysadmin, deploying our software on a rapidly increasing amount of varied platforms, as frequent as we please.The Machines got their revenge, and “we, for ones, welcome our new robotic overlords”!
The Epic Groovy Puzzlers S02: The Revenge of the ParenthesesJavaDayUA
More strange, more bizarre, more fun! The Groovy Puzzlers hits with its second season in which we implemented the lesson learned from the first one – do more of the same (always as a duet)! Expect even more “NO WAY!”, “WHOA!”, “WTF!”, O_o and prizes flying around, and expect to learn more about Groovy’s darkest secrets! As usual, the traps we fell into here in JFrog and contributions from top-notch Groovy authors and users!
This keynote will be a historical trip down memory lane - going through 20 years of Java and JVM implementations. This will be partly from Marcus’s own perspective as one of the architects behind JRockit, with plenty of stories from the trenches, like the benchmarking competitions between BEA/Oracle, Sun and IBM. We will see how Java and the JVM turned into the robust high performance server side platform that it is today, partly through personal observations and partly through a more objective “what a long strange trip this has been”. He will take you back to 1995 in a time machine and slowly bring you to 2014, going over the major Java releases and the runtime innovations made in the JVM side to get us here. Finally, we will do a short trip into the future, even though the future is always fuzzy, to explore what might be coming next. With Java 8, the biggest release in Java history, Java is more vibrant and alive than ever before. This is an evolution that won’t be stopped.
As developers we always look for ways to do things faster, better, and automate as much as possible. We write code in top-notch IDEs that have static code analysis, automatic refactoring and so on, we run unit tests, we use CI servers, and issue trackers, we adopt agile practices to get feedback and deliver as fast as possible. As far as code review practice goes, there’s still a lot to be improved, and in this talk I’m going to tell you how you can perform efficient, transparent and useful code reviews.
Unlocking the Magic of Monads with Java 8JavaDayUA
This code-heavy session demystifies what monads are and outlines reasons why you would even want to introduce them into your code. We’ll take a look at the traditional definition for monads and offer a corresponding type definition in Java. We’ve selected a sample Java 8 implementation of a ‘Promise’ monad, which represents the result of async computation to help us answer practical questions about monads. Also, we'll go over the Laws of Monads and show that you can have a proper monad in Java, if you are brave enough to allow the underlying platform change the rules a bit. PS. You won’t be penalised or ridiculed during this session for your (lack of) Haskell knowledge!
Virtual Private Cloud with container technologies for DevOpsJavaDayUA
DevOps with Containers in Virtual Private Cloud and Hybrid Cloud. A new opportunity for hosting providers to attract Enterprise customers. Containers have changed the mind of IT in DevOps. They enable developers to work with dev, test, stage and production environments identically. Containers provide the right abstraction for Microservices and many cloud platforms have integrated them into deployment pipelines. DevOps and Containers together help companies to achieve their business goals faster and more effectively. At this session we will review the current landscape of DevOps with Containers and the benefits for hosting providers. In addition, we will discuss known issues and solutions for enterprise applications in Containers.
JShell: An Interactive Shell for the Java PlatformJavaDayUA
Read-Execute-Print-Loops (REPLs) have emerged as powerful tools for learning and prototyping. JShell brings this power to Java. Targeted for JDK 9, and tightly integrated with the Java compiler and virtual machine, JShell enhances the programming experience for the Java language. Learn how to use JShell to explore new APIs, prototype code, or learn the Java language. Interactively explore new features of JDK 9. See the features that speed up coding.
Interactive Java Support to your tool -- The JShell API and ArchitectureJavaDayUA
Explore the JShell API. Learn how it can be used to add interactive Java expression/declaration execution to new or existing tools. See how the completion functionality can enhance code editors or analyzers. Get a behind the scenes look at the JShell architecture and its deep integration with the Java platform.
MapDB - taking Java collections to the next levelJavaDayUA
Java collections have several limitations. But imagine library without limits, which could even replace your database. This session talks about drop-in replacement with many new possibilities. MapDB provides Java collections backed by in-memory or on-disk store. It adds extra features to traditional collections (entry expiration, binding, secondary collections…). It is also proper database engine and has transactions, snapshots, incremental backups… And finally it is not affected by GC, so it can take a billion entries without a hiccup.
Java heap memory model has wasteful memory usage. References, object headers, internal collection structure, extra fields such as String.hashCode… This talk shows practical ways to reduce memory usage and fit more data into memory: primitive types, specialized java collections, bit packing, reducing number of pointers, replacing String with char[], semi-serialized objects… As bonus we get lower GC overhead by reducing number of references.
The JRockit JVM was originally developed by Appeal Virtual Machines as a from scratch server-side JVM in order to compete with HotSpot from Sun Microsystems. Appeal Virtual Machines was acquired by BEA Systems in 2002, which in turn became part of Oracle in 2010. JRockit is battle proven in the commercial space as a high performance server JVM and has unique monitoring and manageability capabilities for doing zero overhead instrumentation of production systems. This talk covers the design rationales that the JRockit architects did in code generation, memory management, synchronization and serviceability. The JRockit and HotSpot JVMs are currently in the process of being merged into one code base, most of which will be part of the OpenJDK.
Next-gen DevOps engineering with Docker and Kubernetes by Antons KrangaJavaDayUA
Docker is in font of container madness that forces us to rethink our entire architecture and development practices. This session will be focusing around building Java runtimes on Docker containers and running it with Kubernetes. We will focus on different deployment aspects specific to the Docker and Kubernetes and utilise DevOps engineering managed by Jenkins.
Some previous knowledge of docker is not required however advised
Apache Cassandra. Inception - all you need to know by Mikhail DubkovJavaDayUA
Cassandra is a powerful NoSql database based on solid fundamentals of distributed computing and fail-safe design, and it is well-tested by companies such as Facebook, Twitter, and Netflix. Unlike conventional databases and some of the modern databases that use the master-slave pattern, Cassandra uses the all-nodes-the-same pattern; this makes the system free from a single point of failure.
Solution Architecture tips & tricks by Roman ShramkovJavaDayUA
In this presentation we will cover:
* What is Solution Architecture and how it differs from other architectures
* What is good and what is bad for SA, tips & tricks from our experience
Testing in Legacy: from Rags to Riches by Taras SlipetsJavaDayUA
In this presentation I'd like to share practical experience and techniques that were used for modernization and maintaining 10+ years old legacy system: pitfalls that we've faced during that process and conclusions that we'd made when we've successfully finished updating mission.
Reactive programming and Hystrix fault tolerance by Max MyslyvtsevJavaDayUA
Reactive programming is a new paradigm that provides asynchronous event-based flow control. Java implementation is called rxJava and is being developed by Netfix. They have also released Hystrix — a non-functional layer that provides fault tolerance and latency features which also exposes reactive API.
Spark-driven audience counting by Boris TrofimovJavaDayUA
The story about Ad world and real-time segments counting. Size of data does not allow doing straightforward calculations so we will dive into the solution step-by step involving some "secret" algorithms from Google.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
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.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
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
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
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.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
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.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
2. • lead software engineer in epam
• working on scalable computing and data grids (GigaSpaces, Storm, Spark)
• blog http://dyagilev.org
3. • Abstract Algebra (1900s?) and Category Theory (1940s)
• Mathematicians study abstract structures and relationships between them
4. • Abstract Algebra (1900s?) and Category Theory (1940s)
• Mathematicians study abstract structures and relationships between them
• Early of 1990s, Eugenio Moggi described the general use of monad to
structure programs
5. • Abstract Algebra (1900s?) and Category Theory (1940s)
• Mathematicians study abstract structures and relationships between them
• Early of 1990s, Eugenio Moggi described the general use of monad to
structure programs
• Early of 1990s, monad appeared in Haskell, a purely functional language.
As well as other concepts such as Functor, Monoid, Arrow, etc
6. • Abstract Algebra (1900s?) and Category Theory (1940s)
• Mathematicians study abstract structures and relationships between them
• Early of 1990s, Eugenio Moggi described the general use of monad to
structure programs
• Early of 1990s, monad appeared in Haskell, a purely functional language.
As well as other concepts such as Functor, Monoid, Arrow, etc
• 2003, Martin Odersky creates Scala, a languages that unifies object-
oriented and functional paradigms. Influenced by Haskell, Java, Erlang, etc.
7. • Abstract Algebra (1900s?) and Category Theory (1940s)
• Mathematicians study abstract structures and relationships between them
• Early of 1990s, Eugenio Moggi described the general use of monad to
structure programs
• Early of 1990s, monad appeared in Haskell, a purely functional language.
As well as other concepts such as Functor, Monoid, Arrow, etc
• 2003, Martin Odersky creates Scala, a languages that unifies object-
oriented and functional paradigms. Influenced by Haskell, Java, Erlang, etc.
• 2014, Java 8 released. Functional programming support – lambda, streams
8. • How abstractions from Math (Category Theory, Abstract Algebra) help in functional programming & Big Data
• How to leverage them and become a better programmer
9.
10.
11.
12.
13.
14.
15.
16.
17. User user = findUser(userId);
if (user != null) {
Address address = user.getAddress();
if (address != null) {
String zipCode = address.getZipCode();
if (zipCode != null) {
City city = findCityByZipCode(zipCode);
if (city != null) {
return city.getName();
}
}
}
}
return null;
Example #1
18. Optional<String> cityName = findUser(userId)
.flatMap(user -> user.getAddress())
.flatMap(address -> address.getZipCode())
.flatMap(zipCode -> findCityByZipCode(zipCode))
.map(city -> city.getName());
which
may not return a result.
Refactored with Optional
19. Stream<Employee> employees = companies.stream()
.flatMap(company -> company.departments())
.flatMap(department -> department.employees());
Example #2
which can return several values.
20. • container with a type M<T> (e.g. Optional<T>)
• method M<U> flatMap(T -> M<U>) (e.g. flatMap(T -> Optional<U>))
• constructor to put T into M<T>; same as a static method M<T> unit(T) (e.g. Optional.of(x))
21. • container with a type M<T> (e.g. Optional<T>)
• method M<U> flatMap(T -> M<U>) (e.g. flatMap(T -> Optional<U>))
• constructor to put T into M<T>; same as a static method M<T> unit(T) (e.g. Optional.of(x))
M<U> map(f) { return flatMap(x -> unit(f(x))) }
Bonus: now we can define M<U> map(T -> U)
22. • container with a type M<T> (e.g. Optional<T>)
• method M<U> flatMap(T -> M<U>) (e.g. flatMap(T -> Optional<U>))
• constructor to put T into M<T>; same as a static method M<T> unit(T) (e.g. Optional.of(x))
1. Left identity: unit(x).flatMap(f) = f(x)
2. Right identity: m.flatMap(x -> unit(x)) = m
3. Associativity: m.flatMap(f).flatMap(g) = m.flatMap(x -> f(x).flatMap(g)))
M<U> map(f) { return flatMap(x -> unit(f(x))) }
Bonus: now we can define M<U> map(T -> U)
23. Optional<User> user = findUser(userId);
Optional<Order> order = findOrder(orderId);
Optional<Payment> payment = findPayment(orderId);
Optional<Placement> placement = user
.flatMap(u ->
(order.flatMap(o ->
(payment.map(p -> submitOrder(u, o, p))))));
Java: looks ugly
24. Optional<User> user = findUser(userId);
Optional<Order> order = findOrder(orderId);
Optional<Payment> payment = findPayment(orderId);
Optional<Placement> placement = user
.flatMap(u ->
(order.flatMap(o ->
(payment.map(p -> submitOrder(u, o, p))))));
Java: looks ugly
• Scala, for-comprehension
• Haskell, do-notation
• F#, computational expressions
25. Optional<User> user = findUser(userId);
Optional<Order> order = findOrder(orderId);
Optional<Payment> payment = findPayment(orderId);
Optional<Placement> placement = user
.flatMap(u ->
(order.flatMap(o ->
(payment.map(p -> submitOrder(u, o, p))))));
Java: looks ugly
val placement =
for {
u <- findUser(userId)
o <- findOrder(orderId)
p <- findPayment(orderId)
} yield submitOrder(u, o, p)
Scala: built-in monad Support
• Scala, for-comprehension
• Haskell, do-notation
• F#, computational expressions
26.
27. trait Parser[T] extends (String => ParseResult[T])
sealed abstract class ParseResult[T]
case class Success[T](result: T, rest: String) extends ParseResult[T]
case class Failure() extends ParseResult[Nothing]
val letter: Parser[Char] = …
val digit: Parser[Char] = …
val space: Parser[Char] = …
def map[U](f: T => U): Parser[U] = parser { in => this(in) map f }
def flatMap[U](f: T => Parser[U]): Parser[U] = parser { in => this(in) withNext f }
def * : Parser[List[T]] = …
28. trait Parser[T] extends (String => ParseResult[T])
sealed abstract class ParseResult[T]
case class Success[T](result: T, rest: String) extends ParseResult[T]
case class Failure() extends ParseResult[Nothing]
val letter: Parser[Char] = …
val digit: Parser[Char] = …
val space: Parser[Char] = …
def map[U](f: T => U): Parser[U] = parser { in => this(in) map f }
def flatMap[U](f: T => Parser[U]): Parser[U] = parser { in => this(in) withNext f }
def * : Parser[List[T]] = …
val userParser = for {
firstName <- letter.*
_ <- space
lastName <- letter.*
_ <- space
phone <- digit.*} yield User(firstName, lastName, phone)
“John Doe 0671112222”
29. scala.Option java.Optional Absence of value
scala.List java.Stream Multiple results
scala.Future scalaz.Task java.CompletableFuture Asynchronous computations
scalaz.Reader Read from shared environment
scalaz.Writer Collect data in addition to computed values
scalaz.State Maintain state
scala.Try scalaz./ Handling failures
30. • Remove boilerplate
• Modularity: separate computations from combination strategy
• Composability: compose computations from simple ones
• Improve maintainability
• Better readability
• Vocabulary
31.
32. New data
All data Batch view
Real-time view
Data
stream
Batch processing
Real-time processing
Serving layer
Query
and merge
33. • Write job logic once and run on many Platforms(Hadoop, Storm)
• Library authors talk about monoids all the time
34. • Write job logic once and run on many Platforms(Hadoop, Storm)
• Library authors talk about monoids all the time
def wordCount[P <: Platform[P]]
(source: Producer[P, String], store: P#Store[String, Long]) =
source.flatMap { sentence =>
toWords(sentence).map(_ -> 1L)
}.sumByKey(store)
35. • Write job logic once and run on many Platforms(Hadoop, Storm)
• Library authors talk about monoids all the time
def wordCount[P <: Platform[P]]
(source: Producer[P, String], store: P#Store[String, Long]) =
source.flatMap { sentence =>
toWords(sentence).map(_ -> 1L)
}.sumByKey(store)
def sumByKey(store: P#Store[K, V])(implicit semigroup: Semigroup[V]): Summer[P, K, V] = …
36. Given a set S and a binary operation +, we say that (𝑠, +) is a Semigroup if ∀ 𝑥, 𝑦, 𝑧 ∈ 𝑆:
• Closure: 𝑥 + 𝑦 ∈ 𝑆
• Associativity: (𝑥 + 𝑦) + 𝑧 = 𝑥 + (𝑦 + 𝑧)
Monoid is a semigroup with identity element:
• Identity: ∃ 𝑒 ∈ 𝑆: 𝑒 + 𝑥 = 𝑥 + 𝑒 = 𝑥
• 3 * 2 (numbers under multiplication, 1 is the identity element)
• 1 + 5 (numbers under addition, 0 is the identity element)
• “ab” + “cd” (strings under concatenation, empty string is the identity element)
• many more
41. a b c d e f g h
a + b + c + d + e + fBatch processing
Real-time processing
𝐵0 𝐵1 𝐵2 𝐵3 𝐵4 𝐵5 𝐵6 𝐵7
time1h now
Real-time sums from 0,
each batch
Batch proc. recomputes
total sum
42. a b c d e f g h
a + b + c + d + e + fBatch processing
Real-time processing
𝐵0 𝐵1 𝐵2 𝐵3 𝐵4 𝐵5 𝐵6 𝐵7
time1h now
Query
and sum
real-time + batch
(𝑎 + 𝑏 + 𝑐 + 𝑑 + 𝑒 + 𝑓) + 𝑔 + ℎ
(this is where Semigroup required)
43.
44. Bloom filter is a space-efficient probabilistic data structure to test presence of an element in a set
0 0 0 0 0 0 0 0 0 0 0 0
𝑚
Operations:
• Insert element
• Query if element is present. The answer is either No or Maybe (false positives are possible)
Consists of:
• 𝑘 hash functions: ℎ1, ℎ2, … ℎ 𝑘
• bit array of 𝑚 bits
45. 0 0 1 0 0 0 0 1 0 1 0 0
ℎ1(𝑒) ℎ2(𝑒) … ℎ 𝑘(𝑒)
𝑒
set bit value to 1
46. 0 0 1 0 1 0 1 1 0 0 0 0
ℎ1(𝑒) ℎ2(𝑒) … ℎ 𝑘(𝑒)
𝑒
check if all bits are set to 1
48. A few can be found in in Algebird (Abstract Algebra for Scala) https://github.com/twitter/algebird/
• Bloom Filter
• HyperLogLog
• CountMinSketch
• TopK
• etc
49. • Monad is just a useful pattern in functional programming
• You don’t need to understand Category Theory to use Monads
• Once you grasp the idea, you will see this pattern everywhere
• Semigroup (commutative) and monoid define properties useful in distributed computing and Lambda Architecture.
• It’s all about associativity and commutativity. No nonsense!