Advanced VCL Workshop - Rogier Mulhuijzen and Stephen Basile at Fastly Altitu...Fastly
Fastly Altitude - June 25, 2015. Want to integrate Fastly with a paywall, or learn how to efficiently do a large amount of redirects from VCL? This workshop with Fastly engineers Rogier Mulhuijzen and Stephen Basile is a deep dive into six advanced use cases and the VCL needed for them.
Rogier's bio: Rogier “Doc” Mulhuijzen is a Varnish wizard and senior professional services engineer at Fastly where he focuses on performance tuning and troubleshooting. When he’s not helping customers, he sits on the Varnish Governance Board, where he helps give direction and solve issues for the Varnish open source project. Formerly an Oracle DBA and Unix admin, Rogier learned scaling while working for Ziggo, a major Dutch ISP.
gRPC can help minimize the barrier of cross-system communication by providing language-agnostic API definitions, backward and forward compatible versioning with protocol buffers, and pluggable load balancing and tracing. You will see how to quickly get up and running with the gRPC framework using Node.js from creating a protocol definition, creating meaningful health checks, and securing the endpoint. Additionally, this session will go over best practices and how to take full advantage of what gRPC has to offer.
Advanced VCL Workshop - Rogier Mulhuijzen and Stephen Basile at Fastly Altitu...Fastly
Fastly Altitude - June 25, 2015. Want to integrate Fastly with a paywall, or learn how to efficiently do a large amount of redirects from VCL? This workshop with Fastly engineers Rogier Mulhuijzen and Stephen Basile is a deep dive into six advanced use cases and the VCL needed for them.
Rogier's bio: Rogier “Doc” Mulhuijzen is a Varnish wizard and senior professional services engineer at Fastly where he focuses on performance tuning and troubleshooting. When he’s not helping customers, he sits on the Varnish Governance Board, where he helps give direction and solve issues for the Varnish open source project. Formerly an Oracle DBA and Unix admin, Rogier learned scaling while working for Ziggo, a major Dutch ISP.
gRPC can help minimize the barrier of cross-system communication by providing language-agnostic API definitions, backward and forward compatible versioning with protocol buffers, and pluggable load balancing and tracing. You will see how to quickly get up and running with the gRPC framework using Node.js from creating a protocol definition, creating meaningful health checks, and securing the endpoint. Additionally, this session will go over best practices and how to take full advantage of what gRPC has to offer.
gRPC in Golang presentation
In this talk, I introduced gRPC, Protocol buffer, and how to use them with golang.
Source code used in the presentation: http://github.com/AlmogBaku/grpc-in-go
Supporting several languages is a key point to increase the audience of an application. We will see what is needed in Qt to enable internationalization and how to ensure all the components can be translated. We will also see the tools available for the translators and how to use them.
Presentation by Benjamin Poulain held during Qt Developer Days 2009.
http://qt.nokia.com/developer/learning/elearning
Optimizing Communicating Event-Loop Languages with TruffleStefan Marr
Communicating Event-Loop Languages similar to E and AmbientTalk are recently gaining more traction as a subset of actor languages. With the rise of JavaScript, E’s notion of vats and non-blocking communication based on promises entered the mainstream. For implementations, the combination of dynamic typing, asynchronous message sending, and promise resolution pose new optimization challenges.
This paper discusses these challenges and presents initial experiments for a Newspeak implementation based on the Truffle framework. Our implementation is on average 1.65x slower than Java on a set of 14 benchmarks. Initial optimizations improve the performance of asynchronous messages and reduce the cost of encapsulation on microbenchmarks by about 2x. Parallel actor benchmarks further show that the system scales based on the workload characteristics. Thus, we conclude that Truffle is a promising platform also for communicating event-loop languages.
HotSpot, the JVM we all know and love, is the brain in which our Java and Scala juices flow. At its core lies the JIT (“Just-In-Time”) compiler, whose sole purpose is to make your code run fast. Here are some of the more interesting optimizations performed by it.
In this talk we will discuss the use of gRPC to build a microservices-based application on Kubernetes. We’ll firstly focus on the basic concepts of gRPC: protocol buffers, code generation and HTTP 2.0. We’ll then discuss some more intermediate-level features, such as native Kubernetes load balancing, gRPC streaming, error propagation, HTTP tunneling and instrumentation. Finally we’ll touch on some of the newer, exciting developments in the space: middleware and context propagation for distributed tracing, gRPC Web for client-side rich web apps and gogoproto for blazing-fast generated code. This talk is based on my experience building a hosted, Prometheus-based monitoring service, which itself used gRPC for all intra-server communication and runs on Kubernetes. There’ll be live coding, real world examples and discussion of the benefits (and drawbacks) of gRPC.
Presented at GDG Devfest Ukraine 14th Oct 2017.
Writing concurrent code is becoming more and more important to leverage the parallelism of multicore architectures. The C++11 library introduced futures and promises as a first step towards task-based programming. However, the C++ support of concurrency is still very limited. Other languages, like C# and Python, provide some forms of resumable functions or coroutines and in C#, the async/await pattern enables to write functions that suspend their execution while waiting for a computation or I/O to complete.This talk will describe a proposal for the addition of resumable function and async/await in C++17. We will focus on the implementation of resumable function on Windows, and we'll play with a first prototype of their implementation in the Visual Studio 2015 Preview. Finally, we will see how resumable functions can also be used to implement (lazy) generators, similar to the one provided by "yield" statements in C#.
The objective of the Level 5 Diploma in Information Technology is to provide learners with an excellent foundation for a career in a range of organisations. It designed to ensure that each learner is ‘business ready’: a confident, independent thinker with a detailed knowledge of Information Technology, and equipped with the skills to adapt rapidly to change.
Teach your (micro)services talk Protocol Buffers with gRPC.Mihai Iachimovschi
When it comes to microservices, there’re a lot of things worth keeping in mind. Designing such fine-grained, loosely-coupled services requires paying lots of attention to various patterns and approaches to make them future-proof. A very important thing to consider, is the way those services will communicate with each-other in production. Usually the communication is done over the network using a technology-agnostic protocol. At the next level the service should provide an API for its friend services. Then, the data should be serialized without altering its meaning and transferred to the picked endpoint.
Nowadays, exposing a REST API that operates with JSON over plain HTTP is a usual way to lay the grounds of communication for the services. It is easy to accomplish, but it has some drawbacks. First of all, JSON is a human readable format, and it’s not as other serialization approaches. Also, with JSON it’s not possible to natively enforce the schema, and evolving the API may be painful.
This talk’s purpose is to describe in deep detail the benefits of protocol buffers, that offer us for free an easy way to define the API messages in the proto format, and then reuse them inside different services, without even being locked to use the same programming language for them. Moreover, with gRPC we can define the API’s endpoints easily in the same proto format. All these offer us a robust schema enforcement, compact binary serialization, and easy backward compatibility.
Over recent years, JavaScript has increasingly gained popularity, partly due to libraries that are developed to make JavaScript apps/effects easier to create for those who may not have fully grasped the core language yet.
While in the past it was a common argument that JavaScript was a basic language and was very ‘slap dash’ with no real foundation; this is no longer the case, especially with the introduction of high scale web applications and ‘adaptations’ such as JSON (JavaScript Object Notation).
Slides for presentation on ZooKeeper I gave at Near Infinity (www.nearinfinity.com) 2012 spring conference.
The associated sample code is on GitHub at https://github.com/sleberknight/zookeeper-samples
gRPC in Golang presentation
In this talk, I introduced gRPC, Protocol buffer, and how to use them with golang.
Source code used in the presentation: http://github.com/AlmogBaku/grpc-in-go
Supporting several languages is a key point to increase the audience of an application. We will see what is needed in Qt to enable internationalization and how to ensure all the components can be translated. We will also see the tools available for the translators and how to use them.
Presentation by Benjamin Poulain held during Qt Developer Days 2009.
http://qt.nokia.com/developer/learning/elearning
Optimizing Communicating Event-Loop Languages with TruffleStefan Marr
Communicating Event-Loop Languages similar to E and AmbientTalk are recently gaining more traction as a subset of actor languages. With the rise of JavaScript, E’s notion of vats and non-blocking communication based on promises entered the mainstream. For implementations, the combination of dynamic typing, asynchronous message sending, and promise resolution pose new optimization challenges.
This paper discusses these challenges and presents initial experiments for a Newspeak implementation based on the Truffle framework. Our implementation is on average 1.65x slower than Java on a set of 14 benchmarks. Initial optimizations improve the performance of asynchronous messages and reduce the cost of encapsulation on microbenchmarks by about 2x. Parallel actor benchmarks further show that the system scales based on the workload characteristics. Thus, we conclude that Truffle is a promising platform also for communicating event-loop languages.
HotSpot, the JVM we all know and love, is the brain in which our Java and Scala juices flow. At its core lies the JIT (“Just-In-Time”) compiler, whose sole purpose is to make your code run fast. Here are some of the more interesting optimizations performed by it.
In this talk we will discuss the use of gRPC to build a microservices-based application on Kubernetes. We’ll firstly focus on the basic concepts of gRPC: protocol buffers, code generation and HTTP 2.0. We’ll then discuss some more intermediate-level features, such as native Kubernetes load balancing, gRPC streaming, error propagation, HTTP tunneling and instrumentation. Finally we’ll touch on some of the newer, exciting developments in the space: middleware and context propagation for distributed tracing, gRPC Web for client-side rich web apps and gogoproto for blazing-fast generated code. This talk is based on my experience building a hosted, Prometheus-based monitoring service, which itself used gRPC for all intra-server communication and runs on Kubernetes. There’ll be live coding, real world examples and discussion of the benefits (and drawbacks) of gRPC.
Presented at GDG Devfest Ukraine 14th Oct 2017.
Writing concurrent code is becoming more and more important to leverage the parallelism of multicore architectures. The C++11 library introduced futures and promises as a first step towards task-based programming. However, the C++ support of concurrency is still very limited. Other languages, like C# and Python, provide some forms of resumable functions or coroutines and in C#, the async/await pattern enables to write functions that suspend their execution while waiting for a computation or I/O to complete.This talk will describe a proposal for the addition of resumable function and async/await in C++17. We will focus on the implementation of resumable function on Windows, and we'll play with a first prototype of their implementation in the Visual Studio 2015 Preview. Finally, we will see how resumable functions can also be used to implement (lazy) generators, similar to the one provided by "yield" statements in C#.
The objective of the Level 5 Diploma in Information Technology is to provide learners with an excellent foundation for a career in a range of organisations. It designed to ensure that each learner is ‘business ready’: a confident, independent thinker with a detailed knowledge of Information Technology, and equipped with the skills to adapt rapidly to change.
Teach your (micro)services talk Protocol Buffers with gRPC.Mihai Iachimovschi
When it comes to microservices, there’re a lot of things worth keeping in mind. Designing such fine-grained, loosely-coupled services requires paying lots of attention to various patterns and approaches to make them future-proof. A very important thing to consider, is the way those services will communicate with each-other in production. Usually the communication is done over the network using a technology-agnostic protocol. At the next level the service should provide an API for its friend services. Then, the data should be serialized without altering its meaning and transferred to the picked endpoint.
Nowadays, exposing a REST API that operates with JSON over plain HTTP is a usual way to lay the grounds of communication for the services. It is easy to accomplish, but it has some drawbacks. First of all, JSON is a human readable format, and it’s not as other serialization approaches. Also, with JSON it’s not possible to natively enforce the schema, and evolving the API may be painful.
This talk’s purpose is to describe in deep detail the benefits of protocol buffers, that offer us for free an easy way to define the API messages in the proto format, and then reuse them inside different services, without even being locked to use the same programming language for them. Moreover, with gRPC we can define the API’s endpoints easily in the same proto format. All these offer us a robust schema enforcement, compact binary serialization, and easy backward compatibility.
Over recent years, JavaScript has increasingly gained popularity, partly due to libraries that are developed to make JavaScript apps/effects easier to create for those who may not have fully grasped the core language yet.
While in the past it was a common argument that JavaScript was a basic language and was very ‘slap dash’ with no real foundation; this is no longer the case, especially with the introduction of high scale web applications and ‘adaptations’ such as JSON (JavaScript Object Notation).
Slides for presentation on ZooKeeper I gave at Near Infinity (www.nearinfinity.com) 2012 spring conference.
The associated sample code is on GitHub at https://github.com/sleberknight/zookeeper-samples
Distributed system coordination by zookeeper and introduction to kazoo python...Jimmy Lai
Zookeeper is a coordination tool to let people build distributed systems easier. In this slides, the author summarizes the usage of zookeeper and provides Kazoo Python library as example.
ZooKeeper - wait free protocol for coordinating processesJulia Proskurnia
ZooKeeper is a service for coordinating processes within distributed systems. Stress test of the tool was applied. Reliable Multicast and Dynamic LogBack system Configuration management were implemented with ZooKeeper.
More details: http://proskurnia.in.ua/wiki/zookeeper_research
[Download the slide to get the entire talk in the form of presentation note embedded in the ppt] Apache ZooKeeper is the chosen leader in distributed coordination. In this talk, I have explored the atomic elements of Apache ZooKeeper, how it fits everything together and some of its popular use cases. For ZooKeeper simplicity is the key and as a consumer of the API, our imagination enables us to push the limits of the ZooKeeper world.
My Node.js workshop from Sela's Developer Conference 2015.
In the Workshop we covered The basics Node.js api's and the express web application framework.
This is Apache ZooKeeper session.
ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services.
By the end of this presentation you should be fairly clear about Apache ZooKeeper.
To watch the video or know more about the course, please visit
http://www.knowbigdata.com/page/big-data-and-hadoop-online-instructor-led-training
Introduction to ZooKeeper - TriHUG May 22, 2012mumrah
Presentation given at TriHUG (Triangle Hadoop User Group) on May 22, 2012. Gives a basic overview of Apache ZooKeeper as well as some common use cases, 3rd party libraries, and "gotchas"
Demo code available at https://github.com/mumrah/trihug-zookeeper-demo
How to Make Awesome SlideShares: Tips & TricksSlideShare
Turbocharge your online presence with SlideShare. We provide the best tips and tricks for succeeding on SlideShare. Get ideas for what to upload, tips for designing your deck and more.
Groovy speech I held last year for introducing a new JVM language as substitute of Java. Easy and intuitive, it offers new features unknow to its parent yet.
Go 1.10 Release Party, featuring what's new in Go 1.10 and a few deep dives into how Go works.
Presented at the PDX Go Meetup on April 24th, 2018.
https://www.meetup.com/PDX-Go/events/248938586/
Introduction to Gradle in 45min as done at JBCN 2016. Covers the basics of Gradle for people familiar with other build tools. Includes building Java, Scala, Groovy & Kotlin projects
Grooscript is an open source project, a little framework that convert groovy code to javascript, more info in grooscript.org.
Javascript is cool now, a vibrant community with many new developments. Web development is moving to client size and you must be start to worry about javascript and all the new awesome tools for it. With grooscript, you can join this new wave with our lovely groovy. You can code all the logic of your application in groovy, test with spock, use gradle or any other java or groovy framework. Grooscript will convert your application code to javascript and then you can use it in the browser or Node.js.
In this talk I will introduce about grooscript, how started, how can be used, explore its limitations,… Also I will show grooscript grails plugin, and what do you can do with it. We will take a look at Node.js plugin and gradle plugin, and how to use this tools. I will show some demos of different ways to use grooscript.
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.
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.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
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!
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
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.
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.
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.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
4. Optional syntax
• Optional semincolon
• Optional parentheses for top-
level expressions
println “Hello" //println(“Hello”);
• Optional return
• Optional don in method chain
say "Hello" to “Fred" //say(“Hello”).to("Fred");
class Message {
String message
def to( String person) {
println "$message, $person!"
}
}
def say (String message) {
new Message(message:message)
}
5. Closure
• A snippet of code that
can be assigned to a
variable and executed
later
• We can put closure
outside the argument
list if it’s the last
argument
def p = {
println it
}
def work(input, cl) {
cl(input)
}
work ‘input’, p
work ‘input’, { println it}
work(‘input') { println it}
6. Java integration
In Java code, load and
compile groovy script with
groovy.lang.GroovyClassLo
ader
http://groovy-
lang.org/integrating.html#integ
-groovyshell
GroovyClassLoader gcl = new GroovyClassLoader();
Class aClass = gcl.parseClass(groovyScript);
Script script = (Script) aClass.newInstance();
script.run();
7. DSL
• deposit 100.00 currency GBP
to savings
=>deposit(100.00).currency(GBP
).to(savings)
enum Currency { USD, GBP, EUR }
class Account {
double balance
}
static def convert ( currency, amount) {
def result
switch (currency) {
case Currency.USD: result = amount
break
case Currency.GBP: result = amount * 1.3
break
case Currency.EUR: result = amount * 1.1
}
result
}
static def deposit (double amount) {
[
currency: { Currency currency ->
[to: { account ->
account.balance += convert( currency , amount )
}
]
}
]
}
8. AST transformations
• We can even hook AST transformers to customise
Groovy compilation process for building DSL
9. Gradle DSL
apply plugin: 'java'
task myTask {
setDescription 'this is myTask balabla'
}
call method apply on project with
a map argument [plugin: ‘java’]
call method task on project with
two arguments, a string and a closure
10. Groovy -> Gradle
https://github.com/gdhuang/MyGradle
• Launcher.java: load and compile groovy script with
groovy.lang.GroovyClassLoader
• TaskTransformer.java: TaskTransformer is hooked
to groovy to build task method call.
task myTask {…} => task (myTask, {…})
11. Summary
• We show gradle syntax and ast transformer.
Gradle dynamic semantic, e.g., invokeMethod and
metaclass is left to you
• Gradle is implemented in Java and is powered by
groovy to provide Gradle DSL