As you build more advanced solutions, you may find that certain interactions in your system depend on more than one bounded context. Order, Inventory, Payments, Delivery. To deliver one feature often many sub-system are involved. But you want the modules to be isolated and independent. Yet something must coordinate their work and business processes. Welcome the choreographer - the Saga Pattern a.k.a. Process Manager.
[4developers] The saga pattern v3- Robert PankowieckiPROIDEA
As you build more advanced solutions, you may find that certain interactions in your system depend on more than one bounded context. Order, Inventory, Payments, Delivery. To deliver one feature often many sub-system are involved. But you want the modules to be isolated and independent. Yet something must coordinate their work and business processes. Welcome the choreographer - the Saga Pattern a.k.a. Process Manager. In my talk I would like to: describe the Saga Pattern. show how you can simply introduce it to legacy codebase using existing gems and... ActiveRecord :) describe a few examples of Saga that we have in our systems so the audience can see many places where it fits. convince everyone that it is not so hard
I get frustrated with code that is sprinkled with poorly named classes, methods, and variables. Whenever I work on a team or coach a team, I put a lot of energy into choosing good names and sensitizing my teammates to the power of naming. I've noticed that developers spend most of their days reading code rather than writing code. I suspect you've noticed too. Creating understandable code is a high leverage activity for any team. And naming is where I start.
Simple Design. Domain-Driven Design.
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014Matthias Noback
Events are the new hooks. But what is an event really? How can you best describe an event in your code? What types of events are there, and how do you decide whether or not to implement something as an event?
In this talk we take a look at how events are essential to processing a Request and producing a Response. We take a look at the Symfony EventDispatcher and related classes that you need when you want to hook into this process. When you know all about the event system and how you can implement your own events, we discuss some situations which may or may not be good use cases for events. You will learn to decide if using events is the right solution for your problem.
Have you ever been frustrated with code that is sprinkled with poorly named classes, methods, and variables?
One of the most valuable things you can do as a developer is to choose good names and to sensitize your teammates to the benefits of improving names.
It turns out that improving names is deeply connected to improving design. And vice-versa. You will see and experience this deep connection as we explore a real world example.
Forms are inevitable. Forms are hard. Forms with React sometimes even harder. In this talk, we’ll start by exploring best practices to efficiently work with react/redux forms and proceed with building a custom abstraction layer for easier form management.
[4developers] The saga pattern v3- Robert PankowieckiPROIDEA
As you build more advanced solutions, you may find that certain interactions in your system depend on more than one bounded context. Order, Inventory, Payments, Delivery. To deliver one feature often many sub-system are involved. But you want the modules to be isolated and independent. Yet something must coordinate their work and business processes. Welcome the choreographer - the Saga Pattern a.k.a. Process Manager. In my talk I would like to: describe the Saga Pattern. show how you can simply introduce it to legacy codebase using existing gems and... ActiveRecord :) describe a few examples of Saga that we have in our systems so the audience can see many places where it fits. convince everyone that it is not so hard
I get frustrated with code that is sprinkled with poorly named classes, methods, and variables. Whenever I work on a team or coach a team, I put a lot of energy into choosing good names and sensitizing my teammates to the power of naming. I've noticed that developers spend most of their days reading code rather than writing code. I suspect you've noticed too. Creating understandable code is a high leverage activity for any team. And naming is where I start.
Simple Design. Domain-Driven Design.
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014Matthias Noback
Events are the new hooks. But what is an event really? How can you best describe an event in your code? What types of events are there, and how do you decide whether or not to implement something as an event?
In this talk we take a look at how events are essential to processing a Request and producing a Response. We take a look at the Symfony EventDispatcher and related classes that you need when you want to hook into this process. When you know all about the event system and how you can implement your own events, we discuss some situations which may or may not be good use cases for events. You will learn to decide if using events is the right solution for your problem.
Have you ever been frustrated with code that is sprinkled with poorly named classes, methods, and variables?
One of the most valuable things you can do as a developer is to choose good names and to sensitize your teammates to the benefits of improving names.
It turns out that improving names is deeply connected to improving design. And vice-versa. You will see and experience this deep connection as we explore a real world example.
Forms are inevitable. Forms are hard. Forms with React sometimes even harder. In this talk, we’ll start by exploring best practices to efficiently work with react/redux forms and proceed with building a custom abstraction layer for easier form management.
Explains DOM and Events. HTML-Only DOM is explained and Form elements.
Events handling using element properties and event listeners is explained too.
A quick review on Cookies and referrer is briefed too
MVC is a very popular model and many people claim that they follow it. But, despite of this, many people does not understand what are Models and which role are they playing.
This presentation was done in the Angular Camp of January'2015, explains with AngularJS step by step what happens when we develop Applications and how Models solve a large list of potential problems.
This presentation was very well received by the audience which had been very grateful and claimed to finally understand what models were for.
Previously I have presented MVC - Model: the great forgotten, in which I have explained what models were for.
It was very well received but because it was focused only in the model concept it leak of some important concepts about the whole MVC abstraction or how it make scale into a large AngularJS.
In the previous talk I gave some hints, but not all, and the audience asked for more.
This presentation explains the whole MVS, and adaptation of MVC leveraging in Angular capacities.
It should be presented in the Angular Camp of July 2016, but unfortunately their organizers forgot about it in the votations for talk and different set of talks were selected from the same author.
This talk has been given to some of my customers in private sessions.
Presented to high school teachers participating in CS4HS. Covers writing simple to-do web app in Python on Google App Engine. 30 minutes with Q&A.
Demo at http://cs4hs-tasklist.appspot.com/
Source code at https://github.com/mgp/cs4hs-tasklist
By beginnings of 2016 there was very little information about how to work with Angular2 and almost no information about how to scale large applications.
There was no example of how to do modules, how to inject dependences inside services, how to use ES5 and so on.
In this presentation I explained how it worked and I have also provided an example in ES5 and Typescript how it can be done:
- https://github.com/drpicox/angular2-thedoctoris-ts
- https://github.com/drpicox/angular2-thedoctoris-es5
Reactive Design Patterns: a talk by Typesafe's Dr. Roland KuhnZalando Technology
We had the great pleasure of hosting a talk by Dr. Roland Kuhn: leader of Typesafe’s Akka project, and coauthor of the book Reactive Design Patterns and the Reactive Manifesto. For a standing-room-only crowd, Roland highlighted the importance of making reactive software: of considering responsiveness, maintainability, elasticity and scalability from the outset of development. He explored several architecture elements that are commonly found in reactive systems, such as the circuit breaker, various replication techniques, and flow control protocols. These patterns are language-agnostic and also independent of the abundant choice of reactive programming frameworks and libraries. Check out his slides!
Software is complicated, trying to represent the business logic in code requires allot of communication between the programmers and the domain experts. Domain Driven Design provided methods to facilitate this process
Leveraging more then DDD Lite in the startup projectThomas Jaskula
Short presentation about how Domain Driven Design help me with my startup project. A lightweight CQRS approach was used (commands separated from queries without other ceremony).
Explains DOM and Events. HTML-Only DOM is explained and Form elements.
Events handling using element properties and event listeners is explained too.
A quick review on Cookies and referrer is briefed too
MVC is a very popular model and many people claim that they follow it. But, despite of this, many people does not understand what are Models and which role are they playing.
This presentation was done in the Angular Camp of January'2015, explains with AngularJS step by step what happens when we develop Applications and how Models solve a large list of potential problems.
This presentation was very well received by the audience which had been very grateful and claimed to finally understand what models were for.
Previously I have presented MVC - Model: the great forgotten, in which I have explained what models were for.
It was very well received but because it was focused only in the model concept it leak of some important concepts about the whole MVC abstraction or how it make scale into a large AngularJS.
In the previous talk I gave some hints, but not all, and the audience asked for more.
This presentation explains the whole MVS, and adaptation of MVC leveraging in Angular capacities.
It should be presented in the Angular Camp of July 2016, but unfortunately their organizers forgot about it in the votations for talk and different set of talks were selected from the same author.
This talk has been given to some of my customers in private sessions.
Presented to high school teachers participating in CS4HS. Covers writing simple to-do web app in Python on Google App Engine. 30 minutes with Q&A.
Demo at http://cs4hs-tasklist.appspot.com/
Source code at https://github.com/mgp/cs4hs-tasklist
By beginnings of 2016 there was very little information about how to work with Angular2 and almost no information about how to scale large applications.
There was no example of how to do modules, how to inject dependences inside services, how to use ES5 and so on.
In this presentation I explained how it worked and I have also provided an example in ES5 and Typescript how it can be done:
- https://github.com/drpicox/angular2-thedoctoris-ts
- https://github.com/drpicox/angular2-thedoctoris-es5
Reactive Design Patterns: a talk by Typesafe's Dr. Roland KuhnZalando Technology
We had the great pleasure of hosting a talk by Dr. Roland Kuhn: leader of Typesafe’s Akka project, and coauthor of the book Reactive Design Patterns and the Reactive Manifesto. For a standing-room-only crowd, Roland highlighted the importance of making reactive software: of considering responsiveness, maintainability, elasticity and scalability from the outset of development. He explored several architecture elements that are commonly found in reactive systems, such as the circuit breaker, various replication techniques, and flow control protocols. These patterns are language-agnostic and also independent of the abundant choice of reactive programming frameworks and libraries. Check out his slides!
Software is complicated, trying to represent the business logic in code requires allot of communication between the programmers and the domain experts. Domain Driven Design provided methods to facilitate this process
Leveraging more then DDD Lite in the startup projectThomas Jaskula
Short presentation about how Domain Driven Design help me with my startup project. A lightweight CQRS approach was used (commands separated from queries without other ceremony).
It is widely understood that our software needs to become reactive; we need to consider responsiveness, maintainability, elasticity and scalability from the outset. Not all systems need to implement all these to the same degree, as specific project requirements will determine where effort is most wisely spent. But, in the vast majority of cases, the need to go reactive will demand that we design our applications differently.
In this presentation Dr. Roland Kuhn will explore several architecture elements that are commonly found in reactive systems, like the circuit breaker, various replication techniques, and flow control protocols. These patterns are language agnostic and also independent of the abundant choice of reactive programming frameworks and libraries. They are well-specified starting points for exploring the design space of a concrete problem: thinking is strictly required!
This webinar is based off of Dr. Kuhn’s session, Reactive Design Sessions, presented at WJAX and Code Mesh.
Developing event-driven microservices with event sourcing and CQRS (svcc, sv...Chris Richardson
Modern, cloud-native applications typically use a microservices architecture in conjunction with NoSQL and/or sharded relational databases. However, in order to successfully use this approach you need to solve some distributed data management problems including how to maintain consistency between multiple databases without using 2PC.
In this talk you will learn more about these issues and how to solve them by using an event-driven architecture. We will describe how event sourcing and Command Query Responsibility Segregation (CQRS) are a great way to realize an event-driven architecture. You will learn about a simple yet powerful approach for building, modern, scalable applications.
A Series of Fortunate Events - Symfony Camp Sweden 2014Matthias Noback
What is an event really? How can you best describe an event in your code? What types of events are there, and how do you decide whether or not to implement something as an event?
In this talk we start with a straightforward command-only piece of code. We extract events from it and start moving the event handling code out, trying different design patterns on the way. First we try Observer. Then we introduce event data, event handlers and a Mediator between our code and the event handlers. Finally we pick a well-known event dispatcher implementation (the Symfony EventDispatcher) and see how it uses the Chain of Responsibility design pattern to control the entire flow of a web application request.
In the end I will answer some burning questions like: is it safe to use events all over the place and rely on event handlers to do some really important stuff? How do I overcome the indirection in my event-driven code? And how can I quickly find out what happens where?
A Series of Fortunate Events - PHP Benelux Conference 2015Matthias Noback
What is an event really? How can you best describe an event in your code? What types of events are there, and how do you decide whether or not to implement something as an event?
In this talk we start with a straightforward command-only piece of code. We extract events from it and start moving the event handling code out, trying different design patterns on the way. First we try Observer. Then we introduce event data, event handlers and a Mediator between our code and the event handlers. Finally we pick a well-known event dispatcher implementation (the Symfony EventDispatcher) and see how it uses the Chain of Responsibility design pattern to control the entire flow of a web application request.
In the end I will answer some burning questions like: is it safe to use events all over the place and rely on event handlers to do some really important stuff? How do I overcome the indirection in my event-driven code? And how can I quickly find out what happens where?
Object Oriented programming in Python.
Originally part 3 of a 4 lectures seminar for the Networking class of the Computer Science course at the University of Parma
Brief example how to use Free Monad in Scala (Cats lib). Also this presentation covers combination of two free monads.
Link to video: https://youtu.be/9-2uOyRec_I
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)mircodotta
Microservices architecture are becoming a de-facto industry standard, but are you satisfied with the current state of the art? We are not, as we believe that building microservices today is more challenging than it should be. Lagom is here to take on this challenge. First, Lagom is opinionated and it will take some of the hard decisions for you, guiding you to produce microservices that adheres to the Reactive tenents. Second, Lagom was built from the ground up around you, the developer, to push your productivity to the next level. If you are familiar with the Play Framework's development environment, imagine that but tuned for building microservices; we are sure you are going to love it! Third, Lagom comes with batteries included for deploying in production: going from development to production could not be easier. In this session, you will get an introduction to the Lightbend Lagom framework. There will be code and live demos to show you in practice how it works and what you can do with it, making you fully equipped to build your next microservices with Lightbend Lagom!
The Rule of 10,000 Spark Jobs - Learning from Exceptions and Serializing Your...Matthew Tovbin
Spark + AI Summit, 2019 - Mastering complex software stacks, such as Spark or Hadoop, is a challenging process. Incompatible dependencies, new programming paradigms, runtime errors, outdated documentation, scaling, tuning - this is just a short list of skills we must acquire. How do we make sure that we are not wasting time and making progress learning? How do we share our knowledge efficiently? This talk walks you through a journey of scaling Salesforce Einstein AI platform to serve 6B+ predictions per day and provides you with a scale to measure learning progress.
The Rule of 10,000 Spark Jobs: Learning From Exceptions and Serializing Your ...Databricks
Mastering complex software stacks, such as Spark or Hadoop, is a challenging process. Incompatible dependencies, new programming paradigms, runtime errors, outdated documentation, scaling, tuning - this is just a short list of skills we must acquire. How do we make sure that we are not wasting time and making progress learning? How do we share our knowledge efficiently? This talk walks you through a journey of scaling Salesforce Einstein AI platform to serve 3B+ predictions per day and provides you with a scale to measure learning progress.
Speaker: Matthew Tovbin
Think Async: Asynchronous Patterns in NodeJSAdam L Barrett
JavaScript is single threaded, so understanding the async patterns available in the language is critical to creating maintainable NodeJS applications with good performance. In order to master “thinking in async”, we’ll explore the async patterns available in node and JavaScript including standard callbacks, promises, thunks/tasks, the new async/await, the upcoming asynchronous iteration features, streams, CSP and ES Observables.
Java Svet - Communication Between Android App ComponentsAleksandar Ilić
Presentation about how to build flexible (using fragments), smooth (using async tasks and intent services) and "data up to date" (using loaders) Android applications.
Java Svet - Communication Between Android App ComponentsPSTechSerbia
Presentation about how to build flexible (using fragments), smooth (using async tasks and intent services) and "data up to date" (using loaders) Android applications.
Improving Correctness With Type - Goto Con BerlinIain Hull
A talk I gave at Goto Con Berlin in December 2015
http://workday.github.io/scala/2015/12/03
This talk is aimed at Scala developers with a background in object oriented programming who want to learn new ways to use types to improve the correctness of their code. It introduces the topic in a practical fashion, concentrating on the “easy wins” developers can apply to their code today.
Similar to 2 years after the first event - The Saga Pattern (20)
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
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.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Welocme to ViralQR, your best QR code generator.ViralQR
Welcome to ViralQR, your best QR code generator available on the market!
At ViralQR, we design static and dynamic QR codes. Our mission is to make business operations easier and customer engagement more powerful through the use of QR technology. Be it a small-scale business or a huge enterprise, our easy-to-use platform provides multiple choices that can be tailored according to your company's branding and marketing strategies.
Our Vision
We are here to make the process of creating QR codes easy and smooth, thus enhancing customer interaction and making business more fluid. We very strongly believe in the ability of QR codes to change the world for businesses in their interaction with customers and are set on making that technology accessible and usable far and wide.
Our Achievements
Ever since its inception, we have successfully served many clients by offering QR codes in their marketing, service delivery, and collection of feedback across various industries. Our platform has been recognized for its ease of use and amazing features, which helped a business to make QR codes.
Our Services
At ViralQR, here is a comprehensive suite of services that caters to your very needs:
Static QR Codes: Create free static QR codes. These QR codes are able to store significant information such as URLs, vCards, plain text, emails and SMS, Wi-Fi credentials, and Bitcoin addresses.
Dynamic QR codes: These also have all the advanced features but are subscription-based. They can directly link to PDF files, images, micro-landing pages, social accounts, review forms, business pages, and applications. In addition, they can be branded with CTAs, frames, patterns, colors, and logos to enhance your branding.
Pricing and Packages
Additionally, there is a 14-day free offer to ViralQR, which is an exceptional opportunity for new users to take a feel of this platform. One can easily subscribe from there and experience the full dynamic of using QR codes. The subscription plans are not only meant for business; they are priced very flexibly so that literally every business could afford to benefit from our service.
Why choose us?
ViralQR will provide services for marketing, advertising, catering, retail, and the like. The QR codes can be posted on fliers, packaging, merchandise, and banners, as well as to substitute for cash and cards in a restaurant or coffee shop. With QR codes integrated into your business, improve customer engagement and streamline operations.
Comprehensive Analytics
Subscribers of ViralQR receive detailed analytics and tracking tools in light of having a view of the core values of QR code performance. Our analytics dashboard shows aggregate views and unique views, as well as detailed information about each impression, including time, device, browser, and estimated location by city and country.
So, thank you for choosing ViralQR; we have an offer of nothing but the best in terms of QR code services to meet business diversity!
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
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
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!
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
4. Commands
params,
form objects,
real command objects
module Seating
class BookEntranceCommand
include Command
attribute :booking_id, String
attribute :event_id, Integer
attribute :seats, Array[Seat]
attribute :places, Array[GeneralAdmission]
validates_presence_of :event_id, :booking_id
validate do
unless (seats.present? || places.present?)
errors.add(:base, "Missing seats or places")
end
end
end
end
5. Events
module Seating
module Events
SeatingSetUp = Class.new(EventStore::Event)
SeatingDisabled = Class.new(EventStore::Event)
EntranceBooked = Class.new(EventStore::Event)
EntranceUnBooked = Class.new(EventStore::Event)
end
end
6. Send PDF via
Postal
1. PostalAddedToOrder
2. PostalAddressFilledOut
3. PdfGenerated
4. PaymentPaid
5. => SendPdfViaPostal
8. Publish events
class RegisterUserService
def call(email, password)
user = User.register(email, password)
event_store.publish(Users::UserRegisteredByEmail.new(
id: user.id,
email: user.email,
))
end
end
17. Sync handlers
from EventStore
module Search
class UserRegisteredHandler
def self.perform(event)
new.call(event)
rescue => e
Honeybadger.notify(e)
end
def call(event)
Elasticsearch::Model.client.index(
index: 'users',
type: 'admin_search_user',
id: event.data.fetch(:id),
body: {
email: event.data.fetch(:email)
})
end
end
end
18. Contain
exceptions
in sync handlers
module Search
class UserRegisteredHandler
def self.perform(event)
new.call(event)
rescue => e
Honeybadger.notify(e)
end
end
end
class RegisterUserService
def call(email, password)
ActiveRecord::Base.transaction do
user = User.register(email, password)
event_store.publish(UserRegisteredByEmail.new(
id: user.id,
email: user.email,
))
end
end
end
19. Async handlers
def call(handler_class, event)
if handler_class.instance_variable_defined?(:@queue)
Resque.enqueue(handler_class, YAML.dump(event))
else
handler_class.perform(YAML.dump(event))
end
end
20. Async handlers
(after commit)
def call(handler_class, event)
if handler_class.instance_variable_defined?(:@queue)
if ActiveRecord::Base.connection.transaction_open?
ActiveRecord::Base.
connection.
current_transaction.
add_record( FakeActiveRecord.new(
handler,
YAML.dump(event))
)
else
Resque.enqueue(handler_class, YAML.dump(event))
end
else
handler_class.perform(YAML.dump(event))
end
end
https://blog.arkency.com/2015/10/run-it-in-background-job-after-commit/
23. Initializing the
state of a saga
class PostalSaga
singleton_class.prepend(YamlDeserializeFact)
@queue = :low_priority
# add_index "sagas", ["order_id"], unique: true
class State < ActiveRecord::Base
self.table_name = 'sagas'
def self.get_by_order_id(order_id) do
transaction do
yield lock.find_or_create_by(order_id: order_id)
end
rescue ActiveRecord::RecordNotUnique
retry
end
end
def call(fact)
data = fact.data
State.get_by_order_id(data.fetch(:order_id)) do |state|
state.do_something
state.save!
end
end
end
24. Processing an
event by a saga
class Postal::FilledOut
singleton_class.prepend(YamlDeserializeFact)
@queue = :low_priority
def self.perform(event)
new().call(event)
rescue => e
Honeybadger.notify(e, { context: { event: event } } )
raise
end
def call(event)
data = event.data
order_id = data.fetch(:order_id)
State.get_by_order_id(order_id) do |state|
state.filled_out(
filled_out_at: Time.zone.now,
adapter: Rails.configuration.insurance_adapter,
)
end
end
end
25. Triggering a
command
class Postal::State < ActiveRecord::Base
def added_to_basket(added_to_basket_at:, uploader:)
self.added_to_basket_at ||= added_to_basket_at
save!
maybe_send_postal_via_api(uploader: uploader)
end
def filled_out(filled_out_at:, uploader:)
self.filled_out_at ||= filled_out_at
save!
maybe_send_postal_via_api(uploader: uploader)
end
def paid(paid_at:, uploader:)
self.paid_at ||= paid_at
save!
maybe_send_postal_via_api(uploader: uploader)
end
def tickets_pdf_generated(generated_at:, pdf_id:, uploader:)
return if self.tickets_generated_at
self.tickets_generated_at ||= generated_at
self.pdf_id ||= pdf_id
save!
maybe_send_postal_via_api(uploader: uploader)
end
26. Triggering a
command
class Postal::State < ActiveRecord::Base
private
def maybe_send_postal_via_api(uploader:)
return unless added_to_basket_at && paid_at && filled_out_at
tickets_generated_at
return if uploaded_at
uploader.transmit(Pdf.find(pdf_id))
self.uploaded_at = Time.now
save!
rescue
# error handling...
end
end
27. Triggering a
command
(better way)
class Postal::State < ActiveRecord::Base
private
def maybe_send_postal_via_api
return unless added_to_basket_at && paid_at && filled_out_at
tickets_generated_at
return if uploaded_at
self.uploaded_at = Time.now
save!
command_bus.send(DeliverPostalPdf.new({
order_id: order_id,
pdf_id: pdf_id
}))
end
end
https://github.com/pawelpacana/command_bus