Practical tips for dealing with projects involving legacy code. Covers investigating past projects, static analysis of existing code, and methods for changing legacy code.
Presented at PHP Benelux '10
Refactoring legacy code driven by tests - ENGLuca Minudel
re you working on code poorly designed or on legacy code that’s hard to test? And you cannot refactor it because there are no tests?
During this Coding Dojo you’ll be assigned a coding challenge in Java, C#, Ruby, JavaScript or Python. You will face the challenge of improving the design and refactoring existing code in order to make it testable and to write unit tests.
We will discuss SOLID principles, the relation between design and TDD, and how this applies to your solution.
Reading list:
Growing Object-Oriented Software, Guided by Tests; Steve Freeman, Nat Pryce
Test Driven Development: By Example; Kent Beck
Working Effectively with Legacy; Michael Feathers
Agile Software Development, Principles, Patterns, and Practices; Robert C. Martin (C++, Java)
Agile Principles, Patterns, and Practices in C#; Robert C. Martin (C#)
Unit testing and test-driven development are practices that makes it easy and efficient to create well-structured and well-working code. However, many software projects didn't create unit tests from the beginning.
In this presentation I will show a test automation strategy that works well for legacy code, and how to implement such a strategy on a project. The strategy focuses on characterization tests and refactoring, and the slides contain a detailed example of how to carry through a major refactoring in many tiny steps
The Art of Unit Testing - Towards a Testable DesignVictor Rentea
Slides of the Talk I gave at Devoxx Belgium 2019.
=== Abstract ===
Focusing on the creative work without being terrified of breaking the existing behavior can make software development very addictive! Good automated tests can buy you that!
However, if your tests are not maintainable they may end up slowing you down and causing you painful headaches, compilation errors and spurious failures. To avoid that, your unit tests should be significant; expressive; clean; DRY; non-overlapping; and blazing fast. Writing good tests becomes the toughest challenge for any developer, no matter how battle-hardened: you need to balance risk with test maintenance costs, while looking out for test design smells that call for [risky] refactoring to drive your design towards a set of key principles (included:).
Principles that will end up shaping the way you craft the Production code itself. Because in the end, a good, clean design is more important than coverage%.
But testing gives you the best feedback to get there.
Grab a black coffee and join this snippet from Victor’s Pro Unit Testing #training, to learn about testing priorities, buggy tests, the shared @Before, Mocks vs Stubs and how to reduce them by "purifying" your logic, testing Legacy Code and refactoring @Spy-es out.
All of that in an entertaining, dynamic and memorable session.
You’re finally doing TDD, but your past mistakes are catching up with you. No matter what you do, you can’t get rid of the gaping black holes caused by your legacy code.
In this presentation, we learn about the causes of legacy code and the reasons it is so difficult to work with. Then we discuss various techniques to test untestable code, revive and simplify incomprehensible code, redesign stable yet untested code, and repair that rift we created in the time-space continuum.
Stopping the Rot - Putting Legacy C++ Under TestSeb Rose
Presentation given at the ACCU 2011 Conference in Oxford, UK.
Case study of applying unit test to the DOORS codebase. Includes a quick overview of unit test & the Google Test and Mock libraries. Also 3 specific refactoring examples shown.
Refactoring legacy code driven by tests - ENGLuca Minudel
re you working on code poorly designed or on legacy code that’s hard to test? And you cannot refactor it because there are no tests?
During this Coding Dojo you’ll be assigned a coding challenge in Java, C#, Ruby, JavaScript or Python. You will face the challenge of improving the design and refactoring existing code in order to make it testable and to write unit tests.
We will discuss SOLID principles, the relation between design and TDD, and how this applies to your solution.
Reading list:
Growing Object-Oriented Software, Guided by Tests; Steve Freeman, Nat Pryce
Test Driven Development: By Example; Kent Beck
Working Effectively with Legacy; Michael Feathers
Agile Software Development, Principles, Patterns, and Practices; Robert C. Martin (C++, Java)
Agile Principles, Patterns, and Practices in C#; Robert C. Martin (C#)
Unit testing and test-driven development are practices that makes it easy and efficient to create well-structured and well-working code. However, many software projects didn't create unit tests from the beginning.
In this presentation I will show a test automation strategy that works well for legacy code, and how to implement such a strategy on a project. The strategy focuses on characterization tests and refactoring, and the slides contain a detailed example of how to carry through a major refactoring in many tiny steps
The Art of Unit Testing - Towards a Testable DesignVictor Rentea
Slides of the Talk I gave at Devoxx Belgium 2019.
=== Abstract ===
Focusing on the creative work without being terrified of breaking the existing behavior can make software development very addictive! Good automated tests can buy you that!
However, if your tests are not maintainable they may end up slowing you down and causing you painful headaches, compilation errors and spurious failures. To avoid that, your unit tests should be significant; expressive; clean; DRY; non-overlapping; and blazing fast. Writing good tests becomes the toughest challenge for any developer, no matter how battle-hardened: you need to balance risk with test maintenance costs, while looking out for test design smells that call for [risky] refactoring to drive your design towards a set of key principles (included:).
Principles that will end up shaping the way you craft the Production code itself. Because in the end, a good, clean design is more important than coverage%.
But testing gives you the best feedback to get there.
Grab a black coffee and join this snippet from Victor’s Pro Unit Testing #training, to learn about testing priorities, buggy tests, the shared @Before, Mocks vs Stubs and how to reduce them by "purifying" your logic, testing Legacy Code and refactoring @Spy-es out.
All of that in an entertaining, dynamic and memorable session.
You’re finally doing TDD, but your past mistakes are catching up with you. No matter what you do, you can’t get rid of the gaping black holes caused by your legacy code.
In this presentation, we learn about the causes of legacy code and the reasons it is so difficult to work with. Then we discuss various techniques to test untestable code, revive and simplify incomprehensible code, redesign stable yet untested code, and repair that rift we created in the time-space continuum.
Stopping the Rot - Putting Legacy C++ Under TestSeb Rose
Presentation given at the ACCU 2011 Conference in Oxford, UK.
Case study of applying unit test to the DOORS codebase. Includes a quick overview of unit test & the Google Test and Mock libraries. Also 3 specific refactoring examples shown.
Evolving a Clean, Pragmatic Architecture at JBCNConf 2019Victor Rentea
Are you in a mood for a brainstorm? Join this critical review of the major decisions taken in a typical enterprise application architecture and learn to balance pragmatism with your design goals. Find out how to do just-in-time design to keep as much use-cases as simple as possible. The core purpose of this presentation is to learn to strike a **balance between pragmatism and maintainability** in your design. Without continuous refactoring, a simple design will inevitably degenerate into a Big Ball of Mud, under the assault of the new features and bugfixes. On the other hand, very highly-factored code can burden the take-off of the development and end up freezing the mindset in some rigid 'a-priori' design. The end goal of this talk is to challenge you to rethink critically the architecture of your own systems, and seek ways to simplify it to match your actual needs, with a pragmatic mindset. "Architecture is the art of postponing decisions", said Uncle Bob. This talk takes this idea further and explains an optimal mindset about designing enterprise applications: Evolving (Continuously Refactoring) a Pragmatic (Simple), Clean (aka Onion) Architecture, aiming to provide Developer Safety™️ and Comfort™️. It’s the philosophy that Victor distilled over the past 5 years, designing and implementing 9 applications as IBM Lead Architect, and delivering trainings and advises to many other companies. You’ll learn how to break data into pieces (Fit Entities, Value Objects, Data Transfer Objects), how to keep the logic simple (Facades, Domain Services, logic extraction patterns, Mappers, AOP), layering to enforce boundaries (keeping DTOs out of your logic, Dependency Inversion Principle), and many more, all in a dynamic, interactive and extremely entertaining session.
Mastering Mock Objects - Advanced Unit Testing for JavaDenilson Nastacio
A high-level description of mock testing techniques and their implementation for the Java programming language.
This presentation specifically focus on the JMockit and JMock frameworks.
The following slides summarize and curate most of the knowledge and patterns gathered to date on Node error handling.
Without clear understanding and strategy, Node error handling might be the Achilles heel of your app – its unique single-threaded execution model and loose types raise challenges that don’t exist in any other frameworks. Node by itself doesn’t provide patterns for critical paths like where to put error handling code, even worst it suggest patterns that were rejected by the community like passing errors in callbacks.
It covers topics like promises, generators, callbacks, unhandled exceptions, APM products, testing errors, operational errors vs development errors and much more
Evolving a Clean, Pragmatic Architecture - A Craftsman's GuideVictor Rentea
Talk given at Devoxx Belgium 2019.
===== Abstract =====
Are you in a mood for a brainstorm? Join this critical review of the major decisions taken in a typical enterprise application architecture and learn to balance pragmatism with your design goals. Find out how to do just-in-time design to keep as many use-cases as simple as possible.
The core purpose of this presentation is to learn to strike a **balance between pragmatism and maintainability** in your design. Without continuous refactoring, a simple design will inevitably degenerate into a Big Ball of Mud, under the assault of the new features and bugfixes.
On the other hand, the very highly-factored code can burden the take-off of the development and end up freezing the mindset in some rigid upfront design.
The end goal of this talk is to challenge you to rethink critically the architecture of your systems and seek ways to simplify it to match your actual needs, with a pragmatic mindset. "Architecture is the art of postponing decisions", said Uncle Bob.
This talk takes this idea further and explains an optimal mindset about designing enterprise applications: Evolving (Continuously Refactoring) a Pragmatic (Simple), Clean (aka Onion) Architecture, aiming to provide Developer Safety™️ and Comfort™️.
It’s the philosophy that Victor distilled over the past 5 years, designing and implementing 9 applications as IBM Lead Architect, and delivering training and advises to many other companies.
You’ll learn how to break data into pieces (Fit Entities, Value Objects, Data Transfer Objects), how to keep the logic simple (Facades, Domain Services, logic extraction patterns, Mappers, AOP), layering to enforce boundaries (keeping DTOs out of your logic, Dependency Inversion Principle), and many more, all in a dynamic, interactive and extremely entertaining session.
Why Your Test Suite Sucks - PHPCon PL 2015CiaranMcNulty
Many teams adopt TDD attracted by the promise of a more productive workflow, fewer regressions and higher code quality. Sometimes this goes wrong and these benefits do not materialise, despite a healthy-seeming test suite. In this talk we will look at what the common pitfalls of testing are, why teams fall into these traps, and they can dig themselves out.
First, what are they? And why they are important? What do they allow us to do, and what problems do they shield us from?
After this talk, you'll inevitably fall in love with pure functions and immutable objects. We'll see how to implement them in Java, in the most geek ways possible, concerned about long-term maintainability of the code. Oh, and we'll also have Lombok and records along the way, plus lots of fun while tasting a bit of "a senior developer's night-life".
Given at jLove Dec 2020
KiwiPyCon2011, Wellington, Sunday, Track 1, Automated testing in Python and beyond by Brenda Wallace, Open source hacker @ Weta Digital. Python libraries and extensions. A short intro to unitest and why they are so good for you.
Overview of python unittests and nose, and comparison to popular unittesting frame works in other languages, including perl, php, ruby, java, scala, erlang.
Definitive Guide to Working With Exceptions in Java - takj at Java Champions ...Victor Rentea
A Pragmatic approach to work with exceptions in Java. Talk recording: https://www.youtube.com/watch?v=LRwCE7GreSM&feature=youtu.be
Discussing checked exceptions, Vavr, Lombok, and JooL library, Spring Framework and many more.
Supporting in-depth article series: https://victorrentea.ro/blog/exception-handling-guide-in-java/
A brief overview about how to write human readable and meaningful code. Here is described why and how to write meaningful names of variables or method, what to follow about writing a function for SRP / Open-Closed principle rule, when to write comments and rules of Code Formatting. Advantages of clean code is also described here.
Evolving a Clean, Pragmatic Architecture at JBCNConf 2019Victor Rentea
Are you in a mood for a brainstorm? Join this critical review of the major decisions taken in a typical enterprise application architecture and learn to balance pragmatism with your design goals. Find out how to do just-in-time design to keep as much use-cases as simple as possible. The core purpose of this presentation is to learn to strike a **balance between pragmatism and maintainability** in your design. Without continuous refactoring, a simple design will inevitably degenerate into a Big Ball of Mud, under the assault of the new features and bugfixes. On the other hand, very highly-factored code can burden the take-off of the development and end up freezing the mindset in some rigid 'a-priori' design. The end goal of this talk is to challenge you to rethink critically the architecture of your own systems, and seek ways to simplify it to match your actual needs, with a pragmatic mindset. "Architecture is the art of postponing decisions", said Uncle Bob. This talk takes this idea further and explains an optimal mindset about designing enterprise applications: Evolving (Continuously Refactoring) a Pragmatic (Simple), Clean (aka Onion) Architecture, aiming to provide Developer Safety™️ and Comfort™️. It’s the philosophy that Victor distilled over the past 5 years, designing and implementing 9 applications as IBM Lead Architect, and delivering trainings and advises to many other companies. You’ll learn how to break data into pieces (Fit Entities, Value Objects, Data Transfer Objects), how to keep the logic simple (Facades, Domain Services, logic extraction patterns, Mappers, AOP), layering to enforce boundaries (keeping DTOs out of your logic, Dependency Inversion Principle), and many more, all in a dynamic, interactive and extremely entertaining session.
Mastering Mock Objects - Advanced Unit Testing for JavaDenilson Nastacio
A high-level description of mock testing techniques and their implementation for the Java programming language.
This presentation specifically focus on the JMockit and JMock frameworks.
The following slides summarize and curate most of the knowledge and patterns gathered to date on Node error handling.
Without clear understanding and strategy, Node error handling might be the Achilles heel of your app – its unique single-threaded execution model and loose types raise challenges that don’t exist in any other frameworks. Node by itself doesn’t provide patterns for critical paths like where to put error handling code, even worst it suggest patterns that were rejected by the community like passing errors in callbacks.
It covers topics like promises, generators, callbacks, unhandled exceptions, APM products, testing errors, operational errors vs development errors and much more
Evolving a Clean, Pragmatic Architecture - A Craftsman's GuideVictor Rentea
Talk given at Devoxx Belgium 2019.
===== Abstract =====
Are you in a mood for a brainstorm? Join this critical review of the major decisions taken in a typical enterprise application architecture and learn to balance pragmatism with your design goals. Find out how to do just-in-time design to keep as many use-cases as simple as possible.
The core purpose of this presentation is to learn to strike a **balance between pragmatism and maintainability** in your design. Without continuous refactoring, a simple design will inevitably degenerate into a Big Ball of Mud, under the assault of the new features and bugfixes.
On the other hand, the very highly-factored code can burden the take-off of the development and end up freezing the mindset in some rigid upfront design.
The end goal of this talk is to challenge you to rethink critically the architecture of your systems and seek ways to simplify it to match your actual needs, with a pragmatic mindset. "Architecture is the art of postponing decisions", said Uncle Bob.
This talk takes this idea further and explains an optimal mindset about designing enterprise applications: Evolving (Continuously Refactoring) a Pragmatic (Simple), Clean (aka Onion) Architecture, aiming to provide Developer Safety™️ and Comfort™️.
It’s the philosophy that Victor distilled over the past 5 years, designing and implementing 9 applications as IBM Lead Architect, and delivering training and advises to many other companies.
You’ll learn how to break data into pieces (Fit Entities, Value Objects, Data Transfer Objects), how to keep the logic simple (Facades, Domain Services, logic extraction patterns, Mappers, AOP), layering to enforce boundaries (keeping DTOs out of your logic, Dependency Inversion Principle), and many more, all in a dynamic, interactive and extremely entertaining session.
Why Your Test Suite Sucks - PHPCon PL 2015CiaranMcNulty
Many teams adopt TDD attracted by the promise of a more productive workflow, fewer regressions and higher code quality. Sometimes this goes wrong and these benefits do not materialise, despite a healthy-seeming test suite. In this talk we will look at what the common pitfalls of testing are, why teams fall into these traps, and they can dig themselves out.
First, what are they? And why they are important? What do they allow us to do, and what problems do they shield us from?
After this talk, you'll inevitably fall in love with pure functions and immutable objects. We'll see how to implement them in Java, in the most geek ways possible, concerned about long-term maintainability of the code. Oh, and we'll also have Lombok and records along the way, plus lots of fun while tasting a bit of "a senior developer's night-life".
Given at jLove Dec 2020
KiwiPyCon2011, Wellington, Sunday, Track 1, Automated testing in Python and beyond by Brenda Wallace, Open source hacker @ Weta Digital. Python libraries and extensions. A short intro to unitest and why they are so good for you.
Overview of python unittests and nose, and comparison to popular unittesting frame works in other languages, including perl, php, ruby, java, scala, erlang.
Definitive Guide to Working With Exceptions in Java - takj at Java Champions ...Victor Rentea
A Pragmatic approach to work with exceptions in Java. Talk recording: https://www.youtube.com/watch?v=LRwCE7GreSM&feature=youtu.be
Discussing checked exceptions, Vavr, Lombok, and JooL library, Spring Framework and many more.
Supporting in-depth article series: https://victorrentea.ro/blog/exception-handling-guide-in-java/
A brief overview about how to write human readable and meaningful code. Here is described why and how to write meaningful names of variables or method, what to follow about writing a function for SRP / Open-Closed principle rule, when to write comments and rules of Code Formatting. Advantages of clean code is also described here.
Clinton Nixon describes some common problems found when inheriting legacy PHP applications and how to deal with them. He presents a solution that will encapsulate business logic and clean up the view layer without requiring a full-fledged MVC framework.
PHP 7.1 is all ready to replace 7.0, adding even more features and goodness to the ground-breaking previous version.
Visibility for class constant, key specifications for list, void return type, mcrypt() deprecation, negative offset and warning for integer conversion.
We'll cover new features, deprecated ones and incompatibilities, so you're ready for your next migration.
Transforming legacy PHP applications with Symfony2 and VarnishCraig Marvelley
The careerswales.com platform manages the education and professional progression of millions of people in Wales. When challenged with upgrading its ageing application stack to suit modern standards, we devised a solution with Symfony2 at its core. In this talk I'll discuss how the new stack was implemented, focussing on how we took advantage of Symfony2's first-class support for reverse-proxy Varnish to phase the deployment of the new system and improve performance by a significant amount. I'll also talk about the API we created to bridge its SQL Server / MySQL database platforms, and how Symfony2 was used to provide a single-sign-on solution across all of its web applications.
So you have spent the last few years building PHP applications but now the business requirements have changed and you need to provide a full featured REST API.
You could invest time, money and energy building it yourself, but have a look at Apigility. This is a full REST management application build on ZF2 allows you to tap into your existing legacy PHP application and provide 100% REST endpoints to the outside world.
In this talk I go over the challenges we had to deal with creating our own REST implementation, throwing it all away because we only had 20% of the features of Apigility and setting up and managing Apigiltiy using our existing legacy PHP application.
After this talk you will get a good understanding how to use Apigility to manage your REST API̢
XP Days Ukraine 2014 - Refactoring legacy codeDmytro Mindra
Every programmer has to face legacy code day after day. It might be ugly, it might look scary, it can make a grown man cry. Some will throw it away and try rewriting everything from scratch. Most of them will fail.
Refactoring legacy code is a much better idea. It is not so scary when you take it in very small bites, introduce small changes, add unit tests. When code is refactored and unit tests are added, changes to functinality can be introduced.
We will take an open source C# project and will refactor it showing step-by-step examples of the techniques. This session is full of tips and tricks you can start applying immediately. Although the code is in C#, the same principles can be applied in any language.
Доклад с IT Global Meetup #4 Санкт-Петербург 27.02
mp3 с записью можно скачать здесь http://maxbeard12.podfm.ru/my/2/
видео тут https://www.youtube.com/watch?v=WjQaiKMYIgQ
У вас древний проект? Все зовут его «Legacy», а вас «неудачник»? Возможно они даже смеются над вами.
Давайте взглянем на ситуацию с другого ракурса. Все (все, Карл!) успешные проекты рано или поздно превращаются в Legacy-проекты.
Я затрону тему Legacy не просто как явление, а как возможность быть постоянно в тренде, прослыть супер-спецом (даже если ты знаешь всего два фреймворка), сделать карьеру, как делать, то что ты хочешь, а не то что тебя просят. Ладно, ладно, я наврал про два фреймворка, но все остальное чистая правда. Я покажу, что вы можете творить, имея правильный подход к Legacy коду.
Суть в том, что Legacy — это не грустно/уныло/немодно, это просто/клево/весело, если с умом подойти к задаче!
With more and more sites falling victim to data theft, you've probably read the list of things (not) to do to write secure code. But what else should you do to make sure your code and the rest of your web stack is secure ? In this tutorial we'll go through the basic and more advanced techniques of securing your web and database servers, securing your backend PHP code and your frontend javascript code. We'll also look at how you can build code that detects and blocks intrusion attempts and a bunch of other tips and tricks to make sure your customer data stays secure.
Test-driven development is generally regarded as a good move: it should result in simple decoupled design, your tests tend to cover behaviour not methods, and far fewer bugs. However, just getting unit tests in on a real, commercial project is hard - switching to TDD is even harder. Often you can start a project with good intentions and coverage, then the deadline looms and the tests go out then the hacks come in. So, instead of beating ourselves up about not being perfect let's look at an interative approach to adopting TDD principles. We'll look at tactics for selling TDD to your client, boss and colleagues. This talk will also cover methods for making TDD easier for you by showing you what tools you can use to integrate it into your development environment. In the project itself, we'll examine how we can make small but permanent steps towards full TDD, without losing that progress when deadlines hit. We'll also cover a few methods for learning on your own time and how the whole process can actually be made quite enjoyable.
Talk from 4Developers '12 and PHP Barcelona '11
It’s fun to architect your application to handle millions of pageviews, but in reality that’s time where you could be adding features. We’ll examine some practical solutions for designing your platform to deal with increasing traffic and how to add those features on an incremental basis. This will take us through options for scaling the code and additional methods for scaling the infrastructure.
Talk I gave to The Coding Machine about PHP 8. Overview of the RFC process and which QoL, features and notable BC breaks before finishing on some performance improvements.
TYPO3 Extension development using new Extbase frameworkChristian Trabold
My presentation for the TYPO3 community day in Tokyo, Japan.
The code is available at https://github.com/ctrabold/t3ski-workshop.
Due to copyright issues I had to remove all pictures of Miffy.
In late december 2008 the Eclipse Foundation and the PDT developer team released the Eclipse PHP Development Platform version 2.0. This release comes with a number of enhancements and improvements to the prior version of PDT.
This talk is about these changes. It also gives you an introduction how to prepare your Eclipse PDT workspace to be an accessible and provding companion for your daily work by integrating xDebug, subversive and phpDocumentor using the external tools platform.
Custom, in depth 5 day PHP course I put together in 2014. I'm available to deliver this training in person at your offices - contact me at rich@quicloud.com for rate quotes.
This workshop is a hands-on training where a real Zend Framework application is used as an example to start improving QA using tools to test, document and perform software metric calculations to indicate where the software can be improved. I also explain the reports produced by a CI system.
PHP / MySQL applications are compatible to all operating systems, support all the popular databases, 100% remotely configurable, perfect for web programming & provide higher performance and speed.
PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.
MySQL is a Relational Database Management System (RDBMS) that uses Structured Query Language (SQL).
PHP is the most popular scripting language for web development. It is free, open source and server-side (the code is executed on the server).
PHP third party tool and plug-in integration such as chat, forum, blog and search engine
The why and how of moving to PHP 5.4/5.5Wim Godden
With PHP 5.5 out and many production environments still running 5.2 (or older), it's time to paint a clear picture on why everyone should move to 5.4 and 5.5 and how to get code ready for the latest version of PHP. In this talk, we'll migrate an old piece of code using some standard and some very non-standard tools and techniques.
Von Entwicklern zu tiefst verachtet und in vielen Situationen dennoch heiß geliebt, ist eine ausführliche Dokumentation des Quellcodes. Grade, wenn es um die Anpassung und/oder Erweiterung von legacy Code geht, wird der Ruf nach Dokumentation laut.
PhpDocumentor ist eines von vielen Tools, die uns Entwicklern das dokumentatorische Leben etwas leichter machen können. Es scannt den Quellcode nach Annotationen, Vererbungen, etc. und generiert strukturierte Dokumentationen daraus.
Dieser Vortrag stellt PhpDocumentor im Detail vor und geht nicht nur auf die zahlreichen Möglichkeiten dieses Tools ein, sondern zeigt detailliert anhand von Beispielen, wie diese optimal eingesetzt werden können.
Clients need to know how much a project will cost. Waterfall development is always late and over-budget. Agile development is done when it's done. You're left with estimates that you know are too low and then you squeeze them anyway. It shouldn't be this way. We'll look at how this happens, early warning signs, ways out and ways of avoiding it in the first place.
Access Control Lists are a tool that allows us to map permissions to objects - within Zend_Acl this maps to a hierarchical arrangement of roles and resources.
This talk will follow through the basic use of Zend_Acl and steadily build a series of practical examples to illustrate the different methods of creating and enforcing an ACL for an application. This will include how to implement some of the more complicated hierarchical relationships and advanced conditions through the use of assertions. We will also cover the design considerations of where to attach the ACL, with the differences between applying it to controllers or models. With a functioning ACL in place, we will examine some of the methods for persisting the list and whether that list should be static or dynamic.
Alongside the straight functionality of our code, we will also examine how to effectively unit test it, improving its performance and analysing the level of security that has been created.
A talk for PHPNW09 looking at how to adopt a new software tool in a development department. Breaks the process down into five steps looking at the characters and processes involved at each stage. Includes a few real life examples for Git, PHPUnit, and Zend Framework.
Download to get the notes.
Feedback here:
http://joind.in/614
Smart efficient design using REST and MVC.
Web applications are everywhere now, but many of them misuse the basic concepts laid down by the HTTP protocol, miss the benefits of making the application and the API the same thing, and don't set themselves up to grow if things take off.
This talk will look at the design decisions you need to make to ensure that your application really is ReST-ful, how we fit that cleanly into MVC, and how state machines can help us manage clean state changes in a stateless protocol. The talk will go into some of the available design patterns with class diagrams and code snippets showing how and where to implement them.
Originally presented at PHP UK 2009.
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.
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.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
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
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
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.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
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.
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.
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
22. Time to enter
The Code
Reading
Static analysis
Dynamic analysis
23. http://www.phpdoc.org/
doc
php
Title
phpdoc -ti 'Sweet Application'
-pp -o HTML:Smarty:PHP
-d Libraries Style
-t Docs
Code in here
Docs out here!
24. Beware of type-hiding!
Type-hinting
/**
* @param array $opts Current options
* @return array Options with flag set
*/
function setFlag(array $opts) {
$opts['flag'] = true;
return $opts;
}
Type-hiding
/**
* @param int $fullPence Full price in pence
* @return float Discounted price in pence
*/
function applyDiscount($fullPence) {
return ($fullPence * 0.8);
}
25. ygen
dox
doxygen -s -g ~/doxy.conf
vim ~/doxy.conf
# edit at least this
Code in here OUPUT_DIRECTORY
# play with the rest
cd ~/dev/project
Docs out here
doxygen ~/doxy.conf
http://www.stack.nl/~dimitri/doxygen/
26. http://ctags.sourceforge.net/
ta gs
c
Code in here
#!/bin/bash Tags out here
cd ~/Dev/ &&
ctags-exuberant -f ~/.vimtags
-h ".php" -R
--exclude=".git"
--links=no
--totals=yes
--tag-relative=yes
--PHP-kinds=+cf
--regex-PHP='/abstracts+classs+([^ ]+)/1/c/'
--regex-PHP='/interfaces+([^ ]+)/1/c/'
--regex-PHP='/(publics+|statics+|abstracts+|protecteds+|privates+) ↵
functions+&?s*([^ (]+)/2/f/'
Voodoo
34. ffer
esni
co d
rowan@swordbean:~/Dev/ZendFramework-1.9.4/library/Zend/Service$ phpcs
--standard=Zend Exception.php
FILE: /home/rowan/Dev/ZendFramework-1.9.4/library/Zend/Service/Exception.php
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AND 2 WARNING(S) AFFECTING 3 LINE(S)
--------------------------------------------------------------------------------
17 | WARNING | Line exceeds 80 characters; contains 87 characters
32 | WARNING | Line exceeds 80 characters; contains 87 characters
36 | ERROR | Opening class brace must be on a line by itself
36 | ERROR | Closing brace must be on a line by itself
--------------------------------------------------------------------------------
http://pear.php.net/package/PHP_CodeSniffer/
35. t in uous
Con io n
Inte grat
http://jenkins-ci.org/
http://phpundercontrol.org/
http://sismo.sensiolabs.org/
49. Wrapper class
<?php
include('/home/victorvon/secrets.inc');
/**
* @param array $person willing volunteer
*/
function extract_brain(&$person) {
$brain = $person['brain'];
unset($person['brain']);
}
return $brain; Some code
/**
you need
* @param array $person
* @return bool living or not
:(
*/
function create_life($person) {
require_once(LIB_DIR.'../nuts_n_bolts.inc');
kerzap();
$person['living'] = true;
return $person;
}
?>
50. class VictorWrapper
{ Wrapper class
public function __construct()
{
require_once '/home/victorvon/tragedy.php';
}
public function extractBrain(Person $p) {
// format to legacy style
$pLgcy = $this->toArray($p);
// run legacy code
$bLgy = extract_brain($pLgcy);
// format to new style
$p = $this->toPerson($pLgcy); Some code
$b = $this->toBrain($bLgcy);
return array($p, $b); you can use
}
:)
public function createLife(Person $p)
{
// validate
if ($person->isAlive()) throw new LivingException();
// format to legacy style
$pLgcy = $this->toArray($p);
// run legacy code
$pLgy = create_life($pLgcy);
// format to new style
return $this->toPerson($pLgcy);
}
}
61. includes
HTML PHP HTML
HTML PHP HTML
PHP HTML PHP
PHP
HTML PHP HTML
HTML PHP HTML
PHP
62. includes
function
function
function
includes
HTML PHP HTML HTML echo HTML
HTML PHP HTML HTML echo HTML
PHP HTML PHP if HTML if
PHP foreach
HTML PHP HTML HTML echo HTML
HTML PHP HTML HTML echo HTML
PHP foreach
65. includes includes
function static method
function static method
function static method
function static method
free code static method
66. includes includes includes
function static method constructor
function static method method
function static method method
function static method method
free code static method method
68. public function createInvoice(Account $acc, array $charges)
{
$invoice = new Invoice();
foreach ($charges as $chg) {
$invoice->addLine($chg->getDesc(), $chg->getAmount());
}
return $invoice;
}
The existing code
“We just need to be able to give
each client their own personal
discount on certain charges.”
69. public function createInvoice(Account $acc, array $charges)
{
$invoice = new Invoice();
foreach ($charges as $chg) {
$invoice->addLine($chg->getDesc(), $chg->getAmount());
}
return $invoice;
}
The new code
private function calcDiscount(Account $acc, Charge $chg)
{
$accDisc = new AccountDiscounter($acc);
$discountedCharge = $accDisc->calculate($chg);
return $discountedCharge;
}
70. public function createInvoice(Account $acc, array $charges)
{
$invoice = new Invoice();
Call it
foreach ($charges as $chg) {
// Sprout new behaviour!
$chg = $this->calcDiscount($acc, $chg);
$invoice->addLine($chg->getDesc(), $chg->getAmount());
}
return $invoice;
}
private function calcDiscount(Account $acc, Charge $chg)
{
$accDisc = new AccountDiscounter($acc);
$discountedCharge = $accDisc->calculate($chg);
return $discountedCharge;
}
73. The Problem
public function calcDiscount(Account $acc, Charge $chg)
{
$accDisc = new AccountDiscounter($acc);
$discountedCharge = $accDisc->calculate($chg);
return $discountedCharge;
} Untestable!
74. The Problem
public function calcDiscount(Account $acc, Charge $chg)
{
$accDisc = new AccountDiscounter($acc);
$discountedCharge = $accDisc->calculate($chg);
return $discountedCharge;
} Untestable!
class AccountDiscounter
{
public function __construct(Account $acc)
{
// check cache
// contact the database
// call a web service
}
}
75. Quick Solution
public function calcDiscount(Account $acc, Charge $chg)
{
$accDisc = $this->getAccountDiscounter($acc);
$discountedCharge = $accDisc->calculate($chg);
return $discountedCharge;
}
Mock object in your test
Override method
protected function getAccountDiscounter(Account $acc)
{
return new AccountDiscounter($acc);
}
76. Dependency Injection Solution
public function __construct(AccountDiscounter $ad)
{
$this->discounter = $ad;
}
Pass it into the class
public function calcDiscount(Account $acc, Charge $chg)
{
$accDisc = $this->discounter;
$discountedCharge = $accDisc->calculate($chg);
return $discountedCharge;
}
77. (v2) → Dependency Injection Solution
public function __construct(IAccountDiscounter $ad)
{
$this->discounter = $ad;
}
Make an interface
public function calcDiscount(Account $acc, Charge $chg)
{
$accDisc = $this->discounter;
$discountedCharge = $accDisc->calculate($chg);
return $discountedCharge;
}