This document discusses modeling domains functionally and with an event-driven approach. It describes representing domain entities as algebraic data types (ADTs) and modeling behaviors as pure functions. State changes are handled through immutable updates instead of mutation. The document also discusses event sourcing, where the state of a domain object is represented as a sequence of events rather than a mutable object. This allows reconstructing any previous state. A sample domain model implementation separates the domain objects from the service layer, which acts as a finite state machine handling events and state transitions.
Functional Domain Modeling - The ZIO 2 WayDebasish Ghosh
Principled way to design and implement functional domain models using some of the patterns of domain driven design. DDD, as the name suggests, is focused towards the domain model and the patterns of architecture that it encourages are also based on how we think of interactions amongst the basic abstractions of the domain. Of course the primary goal of the talk is to discuss how Scala and Zio 2 can be a potent combination in realizing the implementation of such models. This is not a talk on FP, the focus will be on how to structure and modularise an application based on some of the patterns of DDD.
The lazy programmer's guide to writing thousands of testsScott Wlaschin
We are all familiar with example-based testing, as typified by TDD and BDD, where each test is hand-crafted.
But there's another approach to writing tests. In the "property-based testing" approach, a single test is run hundreds of times with randomly generated inputs. Property-based testing is a great way to find edge cases, and also helps you to understand and document the behavior of your code under all conditions.
This talk will introduce property-based testing, show you how it works, and demonstrate why you should consider adding this powerful technique to your toolbelt.
Functional Programming Patterns (NDC London 2014)Scott Wlaschin
(video of these slides available here http://fsharpforfunandprofit.com/fppatterns/)
In object-oriented development, we are all familiar with design patterns such as the Strategy pattern and Decorator pattern, and design principles such as SOLID.
The functional programming community has design patterns and principles as well.
This talk will provide an overview of some of these, and present some demonstrations of FP design in practice.
Boost your productivity with Scala tooling!MeriamLachkar1
Our rich ecosystem provides developers with powerful tools that improve productivity on small or huge projects.
In this talk, I will present the tools that allow me to focus on my projects by making tedious tasks easier. From bootstrapping projects, to code linting and refactoring, from continuous integration and automatic publication and documentation rendering, come discover my favorite tools.
Functional Domain Modeling - The ZIO 2 WayDebasish Ghosh
Principled way to design and implement functional domain models using some of the patterns of domain driven design. DDD, as the name suggests, is focused towards the domain model and the patterns of architecture that it encourages are also based on how we think of interactions amongst the basic abstractions of the domain. Of course the primary goal of the talk is to discuss how Scala and Zio 2 can be a potent combination in realizing the implementation of such models. This is not a talk on FP, the focus will be on how to structure and modularise an application based on some of the patterns of DDD.
The lazy programmer's guide to writing thousands of testsScott Wlaschin
We are all familiar with example-based testing, as typified by TDD and BDD, where each test is hand-crafted.
But there's another approach to writing tests. In the "property-based testing" approach, a single test is run hundreds of times with randomly generated inputs. Property-based testing is a great way to find edge cases, and also helps you to understand and document the behavior of your code under all conditions.
This talk will introduce property-based testing, show you how it works, and demonstrate why you should consider adding this powerful technique to your toolbelt.
Functional Programming Patterns (NDC London 2014)Scott Wlaschin
(video of these slides available here http://fsharpforfunandprofit.com/fppatterns/)
In object-oriented development, we are all familiar with design patterns such as the Strategy pattern and Decorator pattern, and design principles such as SOLID.
The functional programming community has design patterns and principles as well.
This talk will provide an overview of some of these, and present some demonstrations of FP design in practice.
Boost your productivity with Scala tooling!MeriamLachkar1
Our rich ecosystem provides developers with powerful tools that improve productivity on small or huge projects.
In this talk, I will present the tools that allow me to focus on my projects by making tedious tasks easier. From bootstrapping projects, to code linting and refactoring, from continuous integration and automatic publication and documentation rendering, come discover my favorite tools.
Domain Driven Design with the F# type System -- F#unctional Londoners 2014Scott Wlaschin
(Video of these slides here http://fsharpforfunandprofit.com/ddd)
Statically typed functional programming languages like F# encourage a very different way of thinking about types. The type system is your friend, not an annoyance, and can be used in many ways that might not be familiar to OO programmers.
Types can be used to represent the domain in a fine-grained, self documenting way. And in many cases, types can even be used to encode business rules so that you literally cannot create incorrect code. You can then use the static type checking almost as an instant unit test — making sure that your code is correct at compile time.
In this talk, we'll look at some of the ways you can use types as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
Code, links to video, etc., at http://fsharpforfunandprofit.com/ddd
NEW AND IMPROVED - added sections on:
* why OO, not FP is scary
* designing with states and transitions
ZIO-Direct allows direct style programming with ZIO. This library provides a *syntactic sugar* that is more powerful than for-comprehensions as well as more natural to use. Simply add the `.run` suffix to any ZIO effect in order to retrieve it's value.
Algebraic Thinking for Evolution of Pure Functional Domain ModelsDebasish Ghosh
The focus of the talk is to emphasize the importance of algebraic thinking when designing pure functional domain models. The talk begins with the definition of an algebra as consisting of a carrier type, a set of operations/functions and a set of laws on those operations. Using examples from the standard library, the talk shows how thinking of abstractions in terms of its algebra is more intuitive than discussing its operational semantics. The talk also discusses the virtues of parametricity and compositionality in designing proper algebras.
Algebras are compositional and help build larger algebras out of smaller ones. We start with base level types available in standard libraries and compose larger programs out of them. We take a real life use case for a domain model and illustrate how we can define the entire model using the power of algebraic composition of the various types. We talk about how to model side-effects as pure abstractions using algebraic effects. At no point we will talk about implementations.
At the end of the talk we will have a working model built completely out of the underlying algebra of the domain language.
(Video of these slides here http://fsharpforfunandprofit.com/rop)
(My response to "this is just Either" here: http://fsharpforfunandprofit.com/rop/#monads)
Many examples in functional programming assume that you are always on the "happy path". But to create a robust real world application you must deal with validation, logging, network and service errors, and other annoyances.
So, how do you handle all this in a clean functional way? This talk will provide a brief introduction to this topic, using a fun and easy-to-understand railway analogy.
ZIO: Powerful and Principled Functional Programming in ScalaWiem Zine Elabidine
This is an introduction of purely functional programming type safe abstractions that provide a variety of features for building asynchronous and concurrent applications data structures built on ZIO.
You'll learn by examples about the power of functional programming to solve the hard problems of software development in a principled, without compromises.
Blazing Fast, Pure Effects without Monads — LambdaConf 2018John De Goes
Effect monads like IO are the way functional programmers interact with the real world. Yet, monadic effects in programming languages like Scala often perform poorly compared to their Haskell counterparts—as much as 10x slower in some benchmarks. In this presentation, John A. De Goes, author of the Scalaz 8 effect system, dredges up an old paper to cast new light on the question of how to model effects, and comes to the surprising conclusion that in Scala, monads may not be the fastest way to model purely functional effects. Join John as he shows a new model of effects that offers performance improvements without sacrificing the wonderful purity that functional programmers rely on to reason about their software.
Presentation given at OSCON 2009 and PostgreSQL West 09. Describes SQL solutions to a selection of object-oriented problems:
- Extensibility
- Polymorphism
- Hierarchies
- Using ORM in MVC application architecture
These slides are excerpted from another presentation, "SQL Antipatterns Strike Back."
(video and more at http://fsharpforfunandprofit.com/fppatterns)
In object-oriented development, we are all familiar with design patterns such as the Strategy pattern and Decorator pattern, and design principles such as SOLID. The functional programming community has design patterns and principles as well. This talk will provide an overview of some of these patterns (such as currying, monads), and present some demonstrations of FP design in practice. We'll also look at some of the ways you can use these patterns as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
The JSON data type and functions that support it comprise one of the most interesting features introduced in MySQL 5.7 for application developers. But no feature is a Golden Hammer. We need to apply a little expertise to get the best of it, and avoid misusing it. I’ll show practical examples that work well with JSON, and other scenarios where conventional columns would perform better. Questions addressed in this presentation: How much space does JSON data use, compared to conventional data? What is the performance of querying JSON vs. conventional data? How do I create indexes for JSON data? What kind of data is best to store in JSON? How do I get the best of both worlds?
Lisp Macros in 20 Minutes (Featuring Clojure)Phil Calçado
"We just started holding 20 minutes presentations during lunch time in the ThoughtWorks Sydney office. For the first session I gave a not-that-short talk on Lisp macros using Clojure. The slides are below.
It turns out that 20 minutes is too little time to actually acquire content but I think at least we now have some people interested in how metaprogramming can be more than monkey patching."
http://fragmental.tw/2009/01/20/presentation-slides-macros-in-20-minutes/
Sum and Product Types -The Fruit Salad & Fruit Snack Example - From F# to Ha...Philip Schwarz
Sum and Product Types -The Fruit Salad & Fruit Snack Example - From F# to Haskell, Scala and Java.
Inspired by the example in Scott Wlaschin’s F# book: Domain Modeling Made Functional.
Download for better results.
Java 19 Code: https://github.com/philipschwarz/fruit-salad-and-fruit-snack-ADT-example-java
Given at DogFoodCon 2016 in Columbus, Ohio
Domain Events, a Domain-Driven Design (DDD) pattern, provide a way to decouple your code. Rather than hard-coding a series of steps that must be completed in response to a particular action a user takes, that action can raise an event. Handlers for an event can be added without changing the code responsible for raising the event, resulting in a more extensible design. Coupled with SignalR or push notifications in the UI layer, domain events can trigger live updates, even to web-based applications and mobile apps.
Domain Driven Design with the F# type System -- F#unctional Londoners 2014Scott Wlaschin
(Video of these slides here http://fsharpforfunandprofit.com/ddd)
Statically typed functional programming languages like F# encourage a very different way of thinking about types. The type system is your friend, not an annoyance, and can be used in many ways that might not be familiar to OO programmers.
Types can be used to represent the domain in a fine-grained, self documenting way. And in many cases, types can even be used to encode business rules so that you literally cannot create incorrect code. You can then use the static type checking almost as an instant unit test — making sure that your code is correct at compile time.
In this talk, we'll look at some of the ways you can use types as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
Code, links to video, etc., at http://fsharpforfunandprofit.com/ddd
NEW AND IMPROVED - added sections on:
* why OO, not FP is scary
* designing with states and transitions
ZIO-Direct allows direct style programming with ZIO. This library provides a *syntactic sugar* that is more powerful than for-comprehensions as well as more natural to use. Simply add the `.run` suffix to any ZIO effect in order to retrieve it's value.
Algebraic Thinking for Evolution of Pure Functional Domain ModelsDebasish Ghosh
The focus of the talk is to emphasize the importance of algebraic thinking when designing pure functional domain models. The talk begins with the definition of an algebra as consisting of a carrier type, a set of operations/functions and a set of laws on those operations. Using examples from the standard library, the talk shows how thinking of abstractions in terms of its algebra is more intuitive than discussing its operational semantics. The talk also discusses the virtues of parametricity and compositionality in designing proper algebras.
Algebras are compositional and help build larger algebras out of smaller ones. We start with base level types available in standard libraries and compose larger programs out of them. We take a real life use case for a domain model and illustrate how we can define the entire model using the power of algebraic composition of the various types. We talk about how to model side-effects as pure abstractions using algebraic effects. At no point we will talk about implementations.
At the end of the talk we will have a working model built completely out of the underlying algebra of the domain language.
(Video of these slides here http://fsharpforfunandprofit.com/rop)
(My response to "this is just Either" here: http://fsharpforfunandprofit.com/rop/#monads)
Many examples in functional programming assume that you are always on the "happy path". But to create a robust real world application you must deal with validation, logging, network and service errors, and other annoyances.
So, how do you handle all this in a clean functional way? This talk will provide a brief introduction to this topic, using a fun and easy-to-understand railway analogy.
ZIO: Powerful and Principled Functional Programming in ScalaWiem Zine Elabidine
This is an introduction of purely functional programming type safe abstractions that provide a variety of features for building asynchronous and concurrent applications data structures built on ZIO.
You'll learn by examples about the power of functional programming to solve the hard problems of software development in a principled, without compromises.
Blazing Fast, Pure Effects without Monads — LambdaConf 2018John De Goes
Effect monads like IO are the way functional programmers interact with the real world. Yet, monadic effects in programming languages like Scala often perform poorly compared to their Haskell counterparts—as much as 10x slower in some benchmarks. In this presentation, John A. De Goes, author of the Scalaz 8 effect system, dredges up an old paper to cast new light on the question of how to model effects, and comes to the surprising conclusion that in Scala, monads may not be the fastest way to model purely functional effects. Join John as he shows a new model of effects that offers performance improvements without sacrificing the wonderful purity that functional programmers rely on to reason about their software.
Presentation given at OSCON 2009 and PostgreSQL West 09. Describes SQL solutions to a selection of object-oriented problems:
- Extensibility
- Polymorphism
- Hierarchies
- Using ORM in MVC application architecture
These slides are excerpted from another presentation, "SQL Antipatterns Strike Back."
(video and more at http://fsharpforfunandprofit.com/fppatterns)
In object-oriented development, we are all familiar with design patterns such as the Strategy pattern and Decorator pattern, and design principles such as SOLID. The functional programming community has design patterns and principles as well. This talk will provide an overview of some of these patterns (such as currying, monads), and present some demonstrations of FP design in practice. We'll also look at some of the ways you can use these patterns as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
The JSON data type and functions that support it comprise one of the most interesting features introduced in MySQL 5.7 for application developers. But no feature is a Golden Hammer. We need to apply a little expertise to get the best of it, and avoid misusing it. I’ll show practical examples that work well with JSON, and other scenarios where conventional columns would perform better. Questions addressed in this presentation: How much space does JSON data use, compared to conventional data? What is the performance of querying JSON vs. conventional data? How do I create indexes for JSON data? What kind of data is best to store in JSON? How do I get the best of both worlds?
Lisp Macros in 20 Minutes (Featuring Clojure)Phil Calçado
"We just started holding 20 minutes presentations during lunch time in the ThoughtWorks Sydney office. For the first session I gave a not-that-short talk on Lisp macros using Clojure. The slides are below.
It turns out that 20 minutes is too little time to actually acquire content but I think at least we now have some people interested in how metaprogramming can be more than monkey patching."
http://fragmental.tw/2009/01/20/presentation-slides-macros-in-20-minutes/
Sum and Product Types -The Fruit Salad & Fruit Snack Example - From F# to Ha...Philip Schwarz
Sum and Product Types -The Fruit Salad & Fruit Snack Example - From F# to Haskell, Scala and Java.
Inspired by the example in Scott Wlaschin’s F# book: Domain Modeling Made Functional.
Download for better results.
Java 19 Code: https://github.com/philipschwarz/fruit-salad-and-fruit-snack-ADT-example-java
Given at DogFoodCon 2016 in Columbus, Ohio
Domain Events, a Domain-Driven Design (DDD) pattern, provide a way to decouple your code. Rather than hard-coding a series of steps that must be completed in response to a particular action a user takes, that action can raise an event. Handlers for an event can be added without changing the code responsible for raising the event, resulting in a more extensible design. Coupled with SignalR or push notifications in the UI layer, domain events can trigger live updates, even to web-based applications and mobile apps.
A look at a modern programming language and how it can enhance the productivity and workflow of developers while promising higher execution performance. We will be talking about metaprogramming, functional programming and type systems in a pragmatic way mixed with some examples from `vibe.d` web framework.
By Yazan Dabain - Senior System Engineer, Arabia Weather
Building occasionally connected applications using event sourcingDennis Doomen
I've recently got the opportunity to work on a large enterprise-class system that needs to be deployed on multiple occasionally connected oil platforms and boats. Already the system's architecture was based on the Command Query Separation principles, this gave us a completely new challenge. After several months of looking at alternatives, we decided to go the Event Sourcing direction. In this in-depth session, I'd like you to learn the many alternatives we observed, the pros and cons, and the technical details of our final solution in which we use EventStore 3.0 and elements of NCQRS and Lokad.CQRS to synchronize systems over unreliable connections in a very efficient way.
Domain-Driven Design provides a set of principles and patterns that are useful for tackling complex software problems. In this session, we'll review a few DDD concepts and demonstrate how they can be applied within an ASP.NET MVC Solution to keep concerns separated and implementation details loosely coupled from business logic and your domain model.
Presented at FalafelCON 2014, San Francisco, September 2014
CQRS and Event Sourcing, An Alternative Architecture for DDDDennis Doomen
Most of us will be familiar with the standard 3- or 4-layer architecture you often see in larger enterprise systems. Some are already practicing Domain Driven Design and work together with the business to clarify the domain concepts. Perhaps you’ve noticed that is difficult to get the intention of the 'verbs' from that domain into this standard architecture. If performance is an important requirement as well, then you might have discovered that an Object-Relational Mapper and a relational database are not always the best solution.
One of the main reasons for this is the fact that the interests of a consistent domain that takes into account the many business rules, and those of data reporting and presentation are conflicting. That’s why Betrand Meyer introduced the Command Query Separation principle.
An architecture based on this principle combined with the Event Sourcing concept provides the ideal architecture for building high-performance systems designed using DDD. Well-known bloggers like Udi Dahan and Greg Young have already spent quite a lot of of posts on this, and this year’s Developer Days had some coverage as well.
But how do you build such a system with the. NET framework? Is it really as complex as some claim, or is just different work?
A Practical Guide to Domain Driven Design: Presentation Slidesthinkddd
Tonight I presented on Domain Driven Design to the Alt.Net group in Sydney at the invite of Richard Banks.
As a follow up, attached are the slides I used, feel free to distribute and use on the Creative Commons Licence
discuss about System system analysis, system design, system analyst's role, Development of System through analysis, SDLC, Case Tools of SAD, Implementation, etc.
Architectural Patterns in Building Modular Domain ModelsDebasish Ghosh
The main theme of the talk is how to use algebraic and functional techniques to build modular domain models that are pure and compositional even in the presence of side-effects. I discuss the use of pure algebraic effects to abstract side-effects thereby keeping the model compositional.
DSL - expressive syntax on top of a clean semantic modelDebasish Ghosh
Does a DSL mean compromising the domain model purity for an ultra-expressive syntax. This presentation discusses how to evolve your DSL syntax as a sublanguage of combinators on top of an expressive domain model.
An overview of the Database Management System, various uses and applications of database, internal architecture of popular RDBMS servers and thier features
Python business intelligence (PyData 2012 talk)Stefan Urbanek
What is the state of business intelligence tools in Python in 2012? How Python is used for data processing and analysis? Different approaches for business data and scientific data.
Video: https://vimeo.com/53063944
Modelling a complex domain with Domain-Driven DesignNaeem Sarfraz
Domain-Driven Design is an approach to modelling business complexity explicitly in your software. This deck of slides runs through the key concepts focusing on both the strategic and tactical aspects of DDD.
It is an Comprehensive ETL Tool, Which provides, end to end ERP Solutions,Some of the Most popular ETL Tools are DSPX leader of ETL Tools, Started from 2006,Informatics,ODI,SAS (ETL STUDIO),BODI,ABNITRO.
For More Follow Below Link:
http://bit.ly/1zMzPjW
Introducing Exhibit pattern. Or how to program controllers and views in such a way that you don't need that many if-statements.
Fully Test-Driven solution.
Eclipse Sirius Applied to a RAD Tool in JapanAkira Tanaka
Presentation made on Dec. 4, 2018 at SiriusCon Live 2018. Explanation of a RAD tool called PEXA, and how Sirius was applied to re-implement PEXA's business analysis graphical modeling tool.
[SiriusCon 2018] Eclipse Sirius applied to a RAD Tool in JapanObeo
SiriusCon 2018 talk by Akira Tanaka, view5 LLC & Ryo Nagamine, Atrris Corp & Takanobu Ouchi, Atrris Corp
Eclipse Sirius applied to a RAD Tool in Japan
Sirius has been applied to a RAD tool (Pexa) in Japan.
This RAD tool is architected as an analysis and execution engine on top of a UML tool. Brief introduction of the tool will be provided.
Our challenge then was to
extract/create an ecore model from the tool with sample diagrams,
implement a “.odesign” file providing similar functionality to the tool,
check to see if Sirius’s I18N support works properly under our language environment,
generate a table similar to a couple of tables provided by the tool.
We believe we have achieved around 80% of the functionality for one of Pexa models, without writing any Java code.
Generating Executable Mappings from RDF Data Cube Data Structure DefinitionsChristophe Debruyne
Data processing is increasingly the subject of various internal and external regulations, such as GDPR which has recently come into effect. Instead of assuming that such processes avail of data sources (such as files and relational databases), we approach the problem in a more abstract manner and view these processes as taking datasets as input. These datasets are then created by pulling data from various data sources. Taking a W3C Recommendation for prescribing the structure of and for describing datasets, we investigate an extension of that vocabulary for the generation of executable R2RML mappings. This results in a top-down approach where one prescribes the dataset to be used by a data process and where to find the data, and where that prescription is subsequently used to retrieve the data for the creation of the dataset “just in time”. We argue that this approach to the generation of an R2RML mapping from a dataset description is the first step towards policy-aware mappings, where the generation takes into account regulations to generate mappings that are compliant. In this paper, we describe how one can obtain an R2RML mapping from a data structure definition in a declarative manner using SPARQL CONSTRUCT queries, and demonstrate it using a running example. Some of the more technical aspects are also described.
Reference: Christophe Debruyne, Dave Lewis, Declan O'Sullivan: Generating Executable Mappings from RDF Data Cube Data Structure Definitions. OTM Conferences (2) 2018: 333-350
This is going to be a discussion about design patterns. But I promise it’s going to be very different from the Gang of Four patterns that we all have used and loved in Java.
It doesn’t have any mathematics or category theory - it’s about developing an insight that lets u identify code structures that u think may be improved with a beautiful transformation of an algebraic pattern.
In earlier days of Java coding we used to feel proud when we could locate a piece of code that could be transformed into an abstract factory and the factory bean could be injected using Spring DI. The result was we ended up maintaining not only Java code, but quite a bit of XML too, untyped and unsafe. This was the DI pattern in full glory. In this session we will discuss patterns that don’t look like external artifacts, they are part of the language, they have some mathematical foundations in the sense that they have an algebra that actually compose and compose organically to evolve larger abstractions.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
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.
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.
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.
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.
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!
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
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.
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Functional and Event Driven - another approach to domain modeling
1. Functional & Event
Driven
another approach to domain modeling
Thursday 12 April 12
2. Debasish Ghosh
@debasishg on Twitter
code @
http://github.com/debasishg
blog @
Ruminations of a Programmer
http://debasishg.blogspot.com
Thursday 12 April 12
3. Agenda
• Domain Models
• Why Functional Domain Models
• Event based architectures - Event Sourcing
• Duality between functional models & even
based models
• A sample event sourced domain model
implementation
Thursday 12 April 12
4. Domain Modeling
• We limit ourselves strictly to how the
domain behaves internally and how it
responds to events that it receives from
the external context
• We think of a domain model as being
comprised of the core granular
abstractions that handle the business logic
and a set of coarser level services that
interacts with the external world
Thursday 12 April 12
5. Why Functional ?
• Pure with localization of side-effects
• Ability to reason about your model
• Expressive & Declarative
• Immutable
Thursday 12 April 12
6. A Functional Domain
Model
• Built on (mostly) pure abstractions
• Pure functions to model domain behaviors
• Immutable artifacts
• .. and you get some parallelism for free
Thursday 12 April 12
7. Immutability
• Algebraic Data Types for representation of
domain entities
• Immutable structures like type-lenses for
functional updates
• No in-place mutation
Thursday 12 April 12
9. Representation as
ADTs
// various tax/fees to be paid when u do a trade
sealed trait TaxFeeId extends Serializable
case object TradeTax extends TaxFeeId
case object Commission extends TaxFeeId
case object VAT extends TaxFeeId
Thursday 12 April 12
10. Pure functions as
domain behaviors
// get the list of tax/fees applicable for this trade
// depends on the market
val forTrade: Trade => Option[List[TaxFeeId]] = {trade =>
taxFeeForMarket.get(trade.market) <+> taxFeeForMarket.get(Other)
}
Thursday 12 April 12
11. Pure functions as
domain behaviors
// enrich a trade with tax/fees and compute net value
val enrichTrade: Trade => Trade = {trade =>
val taxes = for {
taxFeeIds <- forTrade // get the tax/fee ids for a trade
taxFeeValues <- taxFeeCalculate // calculate tax fee values
}
yield(taxFeeIds map taxFeeValues)
val t = taxFeeLens.set(trade, taxes(trade))
netAmountLens.set(t,
t.taxFees.map(_.foldl(principal(t))((a, b) => a + b._2)))
}
Thursday 12 April 12
12. Pure functions as
domain behaviors
// combinator to value a tax/fee for a specific trade
val valueAs:
Trade => TaxFeeId => BigDecimal = {trade => tid =>
((rates get tid) map (_ * principal(trade)))
getOrElse (BigDecimal(0))
}
// all tax/fees for a specific trade
val taxFeeCalculate:
Trade => List[TaxFeeId] => List[(TaxFeeId, BigDecimal)] = {t =>
tids =>
tids zip (tids map valueAs(t))
}
Thursday 12 April 12
13. Composability
Secret sauce ? Functions compose. We can
pass functions as first class citizens in the
paradigm of functional programming. We can
use them as return values and if we can
make them pure we can treat them just as
mathematically as you would like to.
Thursday 12 April 12
14. Updating a Domain
Structure functionally
• A Type-Lens is a data structure that sets up
a bidirectional transformation between a
set of source structures S and target
structures T
• A Type-Lens is set up as a pair of functions:
• get S -> T
• putBack (S X T) -> S
Thursday 12 April 12
15. A Type Lens in Scala
// change ref no
val refNoLens: Lens[Trade, String] =
Lens((t: Trade) => t.refNo,
(t: Trade, r: String) => t.copy(refNo = r))
a function that takes a
trade and returns it’s reference no a function that updates a
trade with a supplied reference no
Thursday 12 April 12
16. Lens under Composition
• What’s the big deal with a Type Lens ?
✦ Lens compose and hence gives you a cool
syntax to update nested structures within
an ADT
def addressL: Lens[Person, Address] = ...
def streetL: Lens[Address, String] = ...
val personStreetL: Lens[Person, String] =
streetL compose addressL
Thursday 12 April 12
17. Lens under
composition
Using the personStreetL lens we may access or
set the (indirect) street property of a Person instance
val str: String =
personStreetL get person
val newP: Person =
personStreetL set (person, "Bob_St")
Thursday 12 April 12
18. Functional updates using type
lens
// change ref no
val refNoLens: Lens[Trade, String] =
Lens((t: Trade) => t.refNo,
(t: Trade, r: String) => t.copy(refNo = r))
// add tax/fees
val taxFeeLens: Lens[Trade, Option[List[(TaxFeeId, BigDecimal)]]] =
Lens((t: Trade) => t.taxFees,
(t: Trade, tfs: Option[List[(TaxFeeId, BigDecimal)]]) =>
t.copy(taxFees = tfs))
// add net amount
val netAmountLens: Lens[Trade, Option[BigDecimal]] =
Lens((t: Trade) => t.netAmount,
(t: Trade, n: Option[BigDecimal]) => t.copy(netAmount = n))
// add value date
val valueDateLens: Lens[Trade, Option[Date]] =
Lens((t: Trade) => t.valueDate,
(t: Trade, d: Option[Date]) => t.copy(valueDate = d))
Thursday 12 April 12
19. Managing States
• But domain objects don’t exist in isolation
• Need to interact with other objects
• .. and respond to events from the external
world
• .. changing from one state to another
Thursday 12 April 12
20. A day in the life of a
Trade object
tax/fee added
created value date added net value computed ssi added
a Trade object
ready for settlement
Thursday 12 April 12
21. What’s the big deal ?
All these sound like changing states of a newly created
Trade object !!
Thursday 12 April 12
22. • but ..
• Changing state through in-place mutation is
destructive
• We lose temporality of the data structure
• The fact that a Trade is enriched with tax/
fee NOW does not mean it was not valued
at 0 tax SOME TIME BACK
Thursday 12 April 12
23. What if we would like to have our
system rolled back to THAT POINT IN
TIME ?
Thursday 12 April 12
25. • The solution is to keep information in such a
way that we have EVERY BIT OF DETAILS
stored as the object changes from one state
to another
• Enter Event Sourcing
Thursday 12 April 12
26. Event Sourcing
• Preserves the temporality of the data
structure
• Represent state NOT as a mutable object,
rather as a sequence of domain events that
took place right from the creation till the
current point in time
• Decouple the state of the object from its
identity. The state changes over time,
identity is IMMUTABLE
Thursday 12 April 12
27. Domain Events as
Behaviors
NewTrade AddValueDate EnrichTrade
state = Created state = ValueDateAdded state = Enriched
persisted with timestamp t0 persisted with timestamp t2
persisted with timestamp t1
(t2 > t1 > t0)
Thursday 12 April 12
28. .. and since we store every event that hits the system we
have the ability to recreate ANY previous state of the
system starting from ANY point in time in the past
Thursday 12 April 12
29. Events and States
sealed trait TradingEvent extends Event
case object NewTrade extends TradingEvent
case object EnrichTrade extends TradingEvent
case object AddValueDate extends TradingEvent
case object SendOutContractNote extends TradingEvent
sealed trait TradeState extends State
case object Created extends TradeState
case object Enriched extends TradeState
case object ValueDateAdded extends TradeState
Thursday 12 April 12
30. The Current State
• How do you reflect the current state of the
domain object ?
✦ start with the initial state
✦ manage all state transitions
✦ persist all state transitions
✦ maintain a snapshot that reflects the
current state
✦ you now have the ability to roll back to
any earlier state
Thursday 12 April 12
31. The essence of Event
Sourcing
Store the events in a durable repository.They are
the lowest level granular structure that model
the actual behavior of the domain.You can
always recreate any state if you store events
since the creation of the domain object.
Thursday 12 April 12
32. The Duality
• Event Sourcing keeps a • In functional
trail of all events that programming, data
the abstraction has structures that keep
handled track of their history are
called persistent data
• Event Sourcing does not structures. Immutability
taken to the next level
ever mutate an existing
record
• An immutable data
structure does not
mutate data - returns a
newer version every
time you update it
Thursday 12 April 12
33. Event Sourced Domain
Models
• Now we have the domain objects receiving
domain events which take them from state
A to state B
• Will the Trade object have all the event
handling logic ?
• What about state changes ? Use the Trade
object for this as well ?
Thursday 12 April 12
34. Separation of concerns
• The Trade object has the core business of
the trading logic. It manifests all state
changes in terms of what it contains as data
• But event handling and managing state
transitions is something that belongs to the
service layer of the domain model
Thursday 12 April 12
35. Separation of Concerns
• The service layer • The core domain layer
✦ receives events from ✦ implements core
the context trading functions like
calculation of value
✦ manages state date, trade valuation,
transitions tax/fee handling etc
✦ delegates to Trade ✦ completely oblivious
object for core of the context
business
✦ notifies other
subscribers
Thursday 12 April 12
36. The Domain Service
Layer
• Handles domain events and delegates to
someone who logs (sources) the events
• May need to maintain an in-memory
snapshot of the domain object’s current
state
• Delegates persistence of the snapshot to
other subscribers like Query Services
Thursday 12 April 12
37. CQRS
• The service layer ensures a complete
decoupling of how it handles updates
(commands) on domain objects and reads
(queries) on the recent snapshot
• Updates are persisted as events while
queries are served from entirely different
sources, typically from read slaves in an
RDBMS
Thursday 12 April 12
38. In other words, the domain
service layer acts as a state
machine
Thursday 12 April 12
39. Making it Explicit
• Model the domain service layer as an FSM
(Finite State Machine) - call it the
TradeLifecycle, which is totally
segregated from the Trade domain object
• .. and let the FSM run within an actor
model based on asynchronous messaging
• We use Akka’s FSM implementation
Thursday 12 April 12
40. FSM in Akka
• Actor based
✦ available as a mixin for the Akka actor
✦ similar to Erlang gen_fsm
implementation
✦ as a client you need to implement the
state transition rules using a declarative
syntax based DSL, all heavy lifting done by
Akka actors
Thursday 12 April 12
41. initial state
match on event
AddValueDate
startWith(Created, trade)
start state of Trade
object
when(Created) {
case Event(e@AddValueDate, data) =>
log.map(_.appendAsync(data.refNo, Created, Some(data), e))
val trd = addValueDate(data)
gossip(trd)
goto(ValueDateAdded) using trd forMax(timeout)
}
notify observers log the event
move to next state
update data
of Trade lifecycle
structure
Thursday 12 April 12
42. Handle events &
process data updates and state
changes
startWith(Created, trade) Log events (event sourcing)
when(Created) {
case Event(e@AddValueDate, data) =>
log.map(_.appendAsync(data.refNo, Created, Some(data), e))
val trd = addValueDate(data)
gossip(trd)
goto(ValueDateAdded) using trd forMax(timeout)
}
Notifying Listeners
Thursday 12 April 12
43. State change -
functionally
// closure for adding a value date
val addValueDate: Trade => Trade = {trade =>
valueDateLens.set(trade, ..)
}
pure referentially transparent implementation
Thursday 12 April 12
44. Notifying Listeners
• A typical use case is to send
updates to the Query
subscribers as in CQRS
• The query is rendered from a
separate store which needs to
be updated with all changes that
go on in the domain model
Thursday 12 April 12
45. Notifications in Akka
FSM
trait FSM[S, D] extends Listeners {
//..
}
Listeners is a generic trait to implement
listening capability on an Actor
trait Listeners {self: Actor =>
protected val listeners = ..
//..
protected def gossip(msg: Any) =
listeners foreach (_ ! msg)
//..
}
Thursday 12 April 12
46. Event Logging
• Log asynchronously
• Persist the current state along with the
data at this state
• Log the event e
log.map(_.appendAsync(data.refNo,
Created,
Some(data), e))
Thursday 12 April 12
49. Order preserving
logging
class RedisEventLog(clients: RedisClientPool, as: ActorSystem)
extends EventLog {
val loggerActorName = "redis-event-logger"
// need a pinned dispatcher to maintain order of log entries
lazy val logger =
as.actorOf(Props(new Logger(clients)).withDispatcher("my-pinned-dispatcher"),
name = loggerActorName)
akka {
//.. actor {
} timeout = 20
my-pinned-dispatcher {
executor = "thread-pool-executor"
type = PinnedDispatcher
}
}
}
Thursday 12 April 12
50. case class LogEvent(objectId: String, state: State,
data: Option[Any], event: Event)
class Logger(clients: RedisClientPool) extends Actor {
implicit val format =
Format {case l: EventLogEntry => serializeEventLogEntry(l)}
implicit val parseList =
Parse[EventLogEntry](deSerializeEventLogEntry(_))
def receive = {
case LogEvent(id, state, data, event) =>
val entry = EventLogEntry(RedisEventLog.nextId(), id, state,
data, event)
clients.withClient {client =>
client.lpush(RedisEventLog.logName, entry)
}
sender ! entry
//..
}
//.. logger is an actor that
pushes event
}
data into Redis
Thursday 12 April 12
52. class TradeLifecycle(trade: Trade, timeout: Duration,
log: Option[EventLog])
extends Actor with FSM[TradeState, Trade] {
import FSM._
startWith(Created, trade)
domain service as
a Finite State Machine
when(Created) {
case Event(e@AddValueDate, data) =>
log.map(_.appendAsync(data.refNo, Created, Some(data), e)) • declarative
val trd = addValueDate(data) • actor based
gossip(trd) • asynchronous
goto(ValueDateAdded) using trd forMax(timeout) • event sourced
}
when(ValueDateAdded) {
case Event(StateTimeout, _) =>
stay
case Event(e@EnrichTrade, data) =>
log.map(_.appendAsync(data.refNo, ValueDateAdded, None, e))
val trd = enrichTrade(data)
gossip(trd)
goto(Enriched) using trd forMax(timeout)
}
//..
}
Thursday 12 April 12
53. // 1. create the state machine
val tlc =
system.actorOf(Props(
new TradeLifecycle(trd, timeout.duration, Some(log))))
// 2. register listeners
tlc ! SubscribeTransitionCallBack(qry)
// 3. fire events
tlc ! AddValueDate
tlc ! EnrichTrade
val future = tlc ? SendOutContractNote
// 4. wait for result
finalTrades += Await.result(future, timeout.duration)
.asInstanceOf[Trade]
Thursday 12 April 12
54. // check query store
val f = qry ? QueryAllTrades
val qtrades = Await.result(f,timeout.duration)
.asInstanceOf[List[Trade]]
// query store in sync with the in-memory snapshot
qtrades should equal(finalTrades)
Thursday 12 April 12
55. Summary
• Event sourcing is an emerging trend in
architecting large systems
• Focuses on immutability and hence plays
along well with functional programming
principles
• Event stores are append only - hence n
locks, no synchronization - very fast at the
event storage layer
Thursday 12 April 12
56. Summary
• Complicated in-memory snapshot may have
some performance overhead, but can be
managed with a good STM implementation
• In designing your domain model based on
event sourcing, make your core model
abstractions meaty enough while leaving the
service layer with the responsibilities of
managing event handling and state
transitions
Thursday 12 April 12