Essa palestra foi feita no TDC 2016 na trilha de PHP Architecture onde a idéia principal é mostrar como aplicar boas práticas e organização de código para atender as necessidades do negócio com uso de uma linguagem simples e autoexplicativa.
This document discusses strategies for dealing with legacy PHP code, including separating controllers and views, removing dependencies on global variables, refactoring procedural code to be object-oriented, and untangling nested require statements. Specific problems in legacy PHP code are said to include mixing of PHP and HTML, overuse of requires instead of method calls, and excessive use of global variables. The document provides examples of refactoring code to address these issues.
The document discusses the importance of unit testing and describes how developers are returning to write good tests after cutting corners during economic difficulties. It provides examples of unit tests being written for an order management system using PHPUnit to test the createOrder method by mocking dependencies and asserting the return value.
PHPUnit is a test suite framework that is widely used for PHP projects. It provides improvements over older testing frameworks like SimpleTest, including better command line tools, code coverage reports, assertions, mock objects, and tool chain support. PHPUnit uses annotations and assertions to make tests stricter and more consistent. It supports features like fixtures, mock objects, and code coverage reporting to help test codebases thoroughly. PHPUnit can be run from the command line or a web interface, and integrates with continuous integration servers to run tests automatically.
Clear PHP is a coding reference for all of us. It tracks recommendations to write clear code, avoiding the classic traps, keeping options opened for the future and preventing decayed code. Those recommendations are above coding conventions, that focuses on code writing, and code architecture, with its design patterns and conceptions. This is the first time in history where an effort was made to collect all those rules, so every project can choose among them, and define exactly his own coding standard.
This document introduces PHPSpec, a BDD framework for PHP inspired by RSpec. It discusses the principles of behavior-driven development (BDD) and test-driven development (TDD), and how PHPSpec implements a domain-specific language (DSL) that allows developers to write specifications in a natural language style. The document provides examples of how to write PHPSpec specifications using its matchers and contexts, run the specifications, and handle pending and failing tests. It also briefly discusses related tools like mocks, screen scraping with Goutte, and how BDD fits into the development cycle.
Everyone talks about raising the bar on the quality of code, but it’s hard to implement when you have no clue where to start. This talk is geared toward all levels of developers, and will teach you how to improve by using the right tools effectively – a must-attend for any PHP developer who wants to scale up their quality.
Michelangelo will tell us about Quality Assurance for PHP in general and show how different QA-related actions can be performed using PhpStorm IDE. The webinar will cover topics including:
Revision control
Syntax checking
Code documentation
Unit Testing with PHPUnit
Measuring code health with a variety of tools
Profiling and debugging with Xdebug
Automation with Phing
Team work and more.
This document discusses quality assurance (QA) for PHP projects. It introduces various QA tools and techniques including syntax checking, documentation, testing, version control and code coverage. Screenshots are provided to illustrate concepts like detecting bugs early, observing behavior and preventing mistakes. The document also includes exercises for attendees to practice setting up version control with Git, running syntax checks with PHP Lint, generating documentation with phpDocumentor, and testing models with PHPUnit.
- The document discusses issues with legacy PHP code and strategies for refactoring it, such as separating PHP code from HTML views, untangling require statements, and removing unnecessary global variables.
- Some specific problems with legacy PHP code include mixing PHP and HTML, using require statements instead of functions, and overuse of global variables.
- The document provides examples of refactoring code by separating views from controllers, wrapping required files in functions, and passing dependencies explicitly rather than relying on globals.
This document discusses strategies for dealing with legacy PHP code, including separating controllers and views, removing dependencies on global variables, refactoring procedural code to be object-oriented, and untangling nested require statements. Specific problems in legacy PHP code are said to include mixing of PHP and HTML, overuse of requires instead of method calls, and excessive use of global variables. The document provides examples of refactoring code to address these issues.
The document discusses the importance of unit testing and describes how developers are returning to write good tests after cutting corners during economic difficulties. It provides examples of unit tests being written for an order management system using PHPUnit to test the createOrder method by mocking dependencies and asserting the return value.
PHPUnit is a test suite framework that is widely used for PHP projects. It provides improvements over older testing frameworks like SimpleTest, including better command line tools, code coverage reports, assertions, mock objects, and tool chain support. PHPUnit uses annotations and assertions to make tests stricter and more consistent. It supports features like fixtures, mock objects, and code coverage reporting to help test codebases thoroughly. PHPUnit can be run from the command line or a web interface, and integrates with continuous integration servers to run tests automatically.
Clear PHP is a coding reference for all of us. It tracks recommendations to write clear code, avoiding the classic traps, keeping options opened for the future and preventing decayed code. Those recommendations are above coding conventions, that focuses on code writing, and code architecture, with its design patterns and conceptions. This is the first time in history where an effort was made to collect all those rules, so every project can choose among them, and define exactly his own coding standard.
This document introduces PHPSpec, a BDD framework for PHP inspired by RSpec. It discusses the principles of behavior-driven development (BDD) and test-driven development (TDD), and how PHPSpec implements a domain-specific language (DSL) that allows developers to write specifications in a natural language style. The document provides examples of how to write PHPSpec specifications using its matchers and contexts, run the specifications, and handle pending and failing tests. It also briefly discusses related tools like mocks, screen scraping with Goutte, and how BDD fits into the development cycle.
Everyone talks about raising the bar on the quality of code, but it’s hard to implement when you have no clue where to start. This talk is geared toward all levels of developers, and will teach you how to improve by using the right tools effectively – a must-attend for any PHP developer who wants to scale up their quality.
Michelangelo will tell us about Quality Assurance for PHP in general and show how different QA-related actions can be performed using PhpStorm IDE. The webinar will cover topics including:
Revision control
Syntax checking
Code documentation
Unit Testing with PHPUnit
Measuring code health with a variety of tools
Profiling and debugging with Xdebug
Automation with Phing
Team work and more.
This document discusses quality assurance (QA) for PHP projects. It introduces various QA tools and techniques including syntax checking, documentation, testing, version control and code coverage. Screenshots are provided to illustrate concepts like detecting bugs early, observing behavior and preventing mistakes. The document also includes exercises for attendees to practice setting up version control with Git, running syntax checks with PHP Lint, generating documentation with phpDocumentor, and testing models with PHPUnit.
- The document discusses issues with legacy PHP code and strategies for refactoring it, such as separating PHP code from HTML views, untangling require statements, and removing unnecessary global variables.
- Some specific problems with legacy PHP code include mixing PHP and HTML, using require statements instead of functions, and overuse of global variables.
- The document provides examples of refactoring code by separating views from controllers, wrapping required files in functions, and passing dependencies explicitly rather than relying on globals.
This document provides an overview and introduction to phpspec, an open source BDD framework for PHP. It covers installing phpspec, generating and editing specs, running specs, different types of matchers for specs including identity, comparison, throw, type and object state matchers. It also briefly mentions formatters, progress reporting, stubbing, mocking and points to additional resources.
This document discusses dependency injection with PHP 5.3. It provides a real world example of managing user preferences like language and authentication status with a User object. By injecting the storage dependency via the constructor rather than hardcoding it, different storage strategies can be used easily and the code is more customizable and testable. The document advocates using a dependency injection container to configure parameters and manage object instantiation and dependencies.
You must’ve heard of Unit testing… If not, then this talk is definitely for you! If you do know Unit testing, you probably ran at some point into a hurdle: “Where do I start?” And despite your best efforts, you end up not having enough tests for your application – Then that change request comes in, requiring you to change that very same complex piece of code for which you are lacking tests! How do you going refactor while maintaining all those ‘undocumented’ business rules? This talk will show how Codeception can be leveraged to refactor the visuals aspects of an application, maintaining backwards compatibility on API changes and even assist in moving to a whole different server infrastructure.
November Camp - Spec BDD with PHPSpec 2Kacper Gunia
My slides on PHPSpec 2 from Symfony November Camp Stockholm.
www.symfony.se/november-camp/
More Domain-Driven Design related content at: https://domaincentric.net/
Slides from my talk at the GTA-PHP Meetup Group about getting mixed HTML / PHP code into objects using SOLID principles.
Meetup page: http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/230656470/
Code is on github: https://github.com/zymsys/solid
PHP7 brings a tremendous number of new features. Tonight, we will take a look at the null coalesce operator, new execution order (uniform variable syntax), new exceptions and more.
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...Rafael Dohms
The document provides advice and best practices for writing code that lasts over time. It discusses improving code through practices like making it more comprehensible, flexible, tested, and refactorable. Specific techniques mentioned include object calisthenics exercises like limiting indentation levels and instance variables, using first class collections, and avoiding getters/setters. The document emphasizes continuously improving code through practices like reading and sharing code with others.
I present four design patterns that make your development easier and better. Design patterns are a fantastic way to make more readable code, as they make use of common ideas that many developers know and use. These patterns are tried and tested in the enterprise world.
The first one is dependency injection. This covers putting the variables that a class needs to function preferably inside a constructor.
The second one is the factory pattern. A factory moves the responsibility of instantiating an object to a third-party class.
The third one is dependency injection. This allows us to place a class' dependencies at one time, making it easy to come back and see what the class needs to survive.
Finally, we discuss the chain of responsibility. This allows complex operations to be handled by a chain of classes. Each class in the chain determines whether it is capable of handling the request and, if so, it returns the result.
So S.O.L.I.D Fu - Designing Better CodeNeil Crookes
A chat about some of the most important principles in software development. Discover or get a refresher on these tried and tested techniques for designing better code.
Code: https://github.com/neilcrookes/SoSOLIDFu/
All projects start with a lot of enthusiasm. As many projects grow the technical debt gets bigger and the enthusiasm gets less. Almost any developer can develop a great project, but the key is maintaining an ever evolving application with minimal technical debt without loosing enthusiasm.
During this talk you will be taken on the journey of application design. The starting point is an application that looks fine but contains lots of potential pitfalls. We will address the problems and solve them with beautiful design. We end up with testable, nicely separated software with a clear intention.
This document outlines the top 5 Magento secure coding best practices: 1) Validate all input as strictly as possible using validation libraries, 2) Use parameterized queries to prevent SQL injection, 3) Escape all user input to prevent XSS attacks, 4) Use CSRF tokens on forms to prevent CSRF attacks, and 5) Implement security headers to enable browser protections. It provides code examples for each practice and additional resources for learning about application security best practices.
Your code sucks, let's fix it - DPC UnConRafael Dohms
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
The document discusses how arrays can help solve challenges in PHP development. It provides examples of using array functions like array_diff(), array_intersect(), and array_filter() to simplify common coding tasks compared to using foreach loops. Iterators are presented as another solution, providing better performance for large datasets than storing everything in arrays. The document advocates using arrays, interfaces, modules, and separation of responsibilities as best practices promoted by the Zend Framework.
The document contains code snippets demonstrating basic PHP syntax including variables, arrays, conditional statements, loops and functions. It also shows examples of including external files, making API requests, and writing/reading CSV files. The code retrieves tweet count data from Twitter APIs and writes it to a CSV alongside URL data from another file.
This PHP document contains code for managing video data in multiple languages. It starts sessions, includes configuration files, and instantiates classes for user login, menus, and video data. If a form is submitted, it validates the fields, checks for errors, and either inserts or updates the video and language data in the database. It handles file uploads and retrieves/displays data for editing. The core functions validate data, insert/update records, and retrieve results for display in the form.
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.
This document provides an overview of quality assurance for PHP projects. It discusses the importance of revision control, documentation, testing, and automation in QA. Revision control systems like SVN and Git are recommended for team development and tracking code versions. PHP Lint is introduced for syntax checking files from the command line. Documenting code with PHPDoc is suggested. Unit testing forms and models is demonstrated using PHPUnit. Validation, filtering, and sanitizing user input is important for protection against exploits. Overall the document promotes establishing strong quality practices like testing, revision control, and documentation for PHP projects.
The document discusses CodeIgniter, an open source PHP MVC framework, and provides information about CodeIgniter features such as controllers, models, views, helpers, libraries, and working with databases using CodeIgniter's active record functions. It also covers topics like installing CodeIgniter, creating controllers and models, and loading views, helpers, and libraries.
This document provides an overview and introduction to phpspec, an open source BDD framework for PHP. It covers installing phpspec, generating and editing specs, running specs, different types of matchers for specs including identity, comparison, throw, type and object state matchers. It also briefly mentions formatters, progress reporting, stubbing, mocking and points to additional resources.
This document discusses dependency injection with PHP 5.3. It provides a real world example of managing user preferences like language and authentication status with a User object. By injecting the storage dependency via the constructor rather than hardcoding it, different storage strategies can be used easily and the code is more customizable and testable. The document advocates using a dependency injection container to configure parameters and manage object instantiation and dependencies.
You must’ve heard of Unit testing… If not, then this talk is definitely for you! If you do know Unit testing, you probably ran at some point into a hurdle: “Where do I start?” And despite your best efforts, you end up not having enough tests for your application – Then that change request comes in, requiring you to change that very same complex piece of code for which you are lacking tests! How do you going refactor while maintaining all those ‘undocumented’ business rules? This talk will show how Codeception can be leveraged to refactor the visuals aspects of an application, maintaining backwards compatibility on API changes and even assist in moving to a whole different server infrastructure.
November Camp - Spec BDD with PHPSpec 2Kacper Gunia
My slides on PHPSpec 2 from Symfony November Camp Stockholm.
www.symfony.se/november-camp/
More Domain-Driven Design related content at: https://domaincentric.net/
Slides from my talk at the GTA-PHP Meetup Group about getting mixed HTML / PHP code into objects using SOLID principles.
Meetup page: http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/230656470/
Code is on github: https://github.com/zymsys/solid
PHP7 brings a tremendous number of new features. Tonight, we will take a look at the null coalesce operator, new execution order (uniform variable syntax), new exceptions and more.
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHP Yo...Rafael Dohms
The document provides advice and best practices for writing code that lasts over time. It discusses improving code through practices like making it more comprehensible, flexible, tested, and refactorable. Specific techniques mentioned include object calisthenics exercises like limiting indentation levels and instance variables, using first class collections, and avoiding getters/setters. The document emphasizes continuously improving code through practices like reading and sharing code with others.
I present four design patterns that make your development easier and better. Design patterns are a fantastic way to make more readable code, as they make use of common ideas that many developers know and use. These patterns are tried and tested in the enterprise world.
The first one is dependency injection. This covers putting the variables that a class needs to function preferably inside a constructor.
The second one is the factory pattern. A factory moves the responsibility of instantiating an object to a third-party class.
The third one is dependency injection. This allows us to place a class' dependencies at one time, making it easy to come back and see what the class needs to survive.
Finally, we discuss the chain of responsibility. This allows complex operations to be handled by a chain of classes. Each class in the chain determines whether it is capable of handling the request and, if so, it returns the result.
So S.O.L.I.D Fu - Designing Better CodeNeil Crookes
A chat about some of the most important principles in software development. Discover or get a refresher on these tried and tested techniques for designing better code.
Code: https://github.com/neilcrookes/SoSOLIDFu/
All projects start with a lot of enthusiasm. As many projects grow the technical debt gets bigger and the enthusiasm gets less. Almost any developer can develop a great project, but the key is maintaining an ever evolving application with minimal technical debt without loosing enthusiasm.
During this talk you will be taken on the journey of application design. The starting point is an application that looks fine but contains lots of potential pitfalls. We will address the problems and solve them with beautiful design. We end up with testable, nicely separated software with a clear intention.
This document outlines the top 5 Magento secure coding best practices: 1) Validate all input as strictly as possible using validation libraries, 2) Use parameterized queries to prevent SQL injection, 3) Escape all user input to prevent XSS attacks, 4) Use CSRF tokens on forms to prevent CSRF attacks, and 5) Implement security headers to enable browser protections. It provides code examples for each practice and additional resources for learning about application security best practices.
Your code sucks, let's fix it - DPC UnConRafael Dohms
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
The document discusses how arrays can help solve challenges in PHP development. It provides examples of using array functions like array_diff(), array_intersect(), and array_filter() to simplify common coding tasks compared to using foreach loops. Iterators are presented as another solution, providing better performance for large datasets than storing everything in arrays. The document advocates using arrays, interfaces, modules, and separation of responsibilities as best practices promoted by the Zend Framework.
The document contains code snippets demonstrating basic PHP syntax including variables, arrays, conditional statements, loops and functions. It also shows examples of including external files, making API requests, and writing/reading CSV files. The code retrieves tweet count data from Twitter APIs and writes it to a CSV alongside URL data from another file.
This PHP document contains code for managing video data in multiple languages. It starts sessions, includes configuration files, and instantiates classes for user login, menus, and video data. If a form is submitted, it validates the fields, checks for errors, and either inserts or updates the video and language data in the database. It handles file uploads and retrieves/displays data for editing. The core functions validate data, insert/update records, and retrieve results for display in the form.
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.
This document provides an overview of quality assurance for PHP projects. It discusses the importance of revision control, documentation, testing, and automation in QA. Revision control systems like SVN and Git are recommended for team development and tracking code versions. PHP Lint is introduced for syntax checking files from the command line. Documenting code with PHPDoc is suggested. Unit testing forms and models is demonstrated using PHPUnit. Validation, filtering, and sanitizing user input is important for protection against exploits. Overall the document promotes establishing strong quality practices like testing, revision control, and documentation for PHP projects.
The document discusses CodeIgniter, an open source PHP MVC framework, and provides information about CodeIgniter features such as controllers, models, views, helpers, libraries, and working with databases using CodeIgniter's active record functions. It also covers topics like installing CodeIgniter, creating controllers and models, and loading views, helpers, and libraries.
The document discusses refactoring legacy PHP code, specifically dealing with code that has no separation between PHP and HTML. It recommends separating code into controllers and views by gathering all code, separating controller and view code, assigning variables to a view object, changing variable references in the view code, and splitting the files. Specific problems in legacy PHP code like no separation of concerns, global variables, and reliance on includes can be addressed through techniques like creating view classes, encapsulating logic in objects, and wrapping includes in functions to untangle dependency webs. The goal is to safely change code implementation without changing behavior through refactoring.
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Mike Schinkel
This document provides an overview of hardcore URL routing in WordPress. It discusses how URLs get routed through rewrite rules and patterns, and various functions and hooks in the Rewrite API that can be used to add custom routes. These include registering post types and taxonomies, adding rewrite rules and tags, validating taxonomy terms, and adding endpoints and permastructs. It emphasizes the importance of flushing rewrite rules when making changes.
In 2010, I told everyone how to start unit testing Zend Framework applications. In 2011, let’s take this a step further by testing services, work flows and performance. Looking to raise the bar on quality? Let this talk be the push you need to improve your Zend Framework projects.
Everyone talks about raising the bar on quality of code, but it's always hard to start implementing it when you have no clue where to start. With this talk I'm shooing that there are many levels developers can improve themselves by using the right tools. In this talk I'll go over each tool with examples how to use them against your codebase. A must attend talk for every developer that wants to scale up their quality. Most PHP developers deploy code that does what the customer requested but they don't have a clue about the quality of the product they deliver. Without this knowledge, maintenance can be a hell and very expensive. In this workshop I cover unit testing, code measuring, performance testing, debugging and profiling and give tips and tricks how to continue after this workshop.
Everyone talks about raising the bar on quality of code, but it's always hard to start implementing it when you have no clue where to start. With this talk I'm shooing that there are many levels developers can improve themselves by using the right tools. In this talk I'll go over each tool with examples how to use them against your codebase. A must attend talk for every developer that wants to scale up their quality. Most PHP developers deploy code that does what the customer requested but they don't have a clue about the quality of the product they deliver. Without this knowledge, maintenance can be a hell and very expensive. In this workshop I cover unit testing, code measuring, performance testing, debugging and profiling and give tips and tricks how to continue after this workshop.
This document provides instructions on how to set up a PHP development environment including installing PHP, a web server, PHPMyAdmin, and configuring PHP error reporting. It also demonstrates connecting to a database in PHP using MySQLi and executing queries like SELECT, INSERT, and prepared statements. Finally, it proposes exploring more advanced PHP topics like integrating with JavaScript and developing software as a team using GitHub.
Gail villanueva add muscle to your wordpress sitereferences
Gail Villanueva presented ways to add functionality to WordPress websites, including creating custom post types, taxonomies, fields and templates. She demonstrated how to build a job listing site, portfolio, or online store using WordPress. Useful plugins were recommended for custom post types, portfolios, job listings and e-commerce. The presentation provided code examples for custom fields, templates and queries.
The document discusses building testable PHP applications. It covers topics like testing code, testable architecture, dependency injection, and static code analysis tools like PHP Code Sniffer, PHP Mess Detector, and PHP Copy Paster Detector. The document emphasizes that writing tests and designing for testability leads to fewer bugs and more maintainable code. It provides examples of unit testing and recommends test-driven development practices.
The document summarizes key points from a WordPress meetup discussion on plugin development:
- Mostafa Soufi discussed why developers make plugins and what plugins are comprised of. He suggested starting a new plugin by creating directories and files and adding a readme file.
- Navid Kashani recommended focusing on support from the beginning by improving support processes, solving issues proactively, setting metrics, and using a central support channel like Slack. Hiring a support person is not necessary initially.
- The discussion covered plugin best practices like internationalization, shortcodes, activation hooks, caching with transients, security techniques, and answering questions from attendees.
The document summarizes best practices for WordPress development. It recommends leveraging WordPress core functionality through APIs and hooks, contributing to core, internationalizing code, and following coding standards to write clean, readable code. It also emphasizes allowing others to hook into code through actions and filters and the importance of sanitization, escaping and security.
This document summarizes some new features in PHP 5.4:
- Array syntax can now be written more concisely using square brackets instead of array functions.
- PHP 5.4 includes a built-in web server for development purposes, allowing PHP scripts to be run without Apache.
- Traits allow sharing of methods across classes to reduce code duplication, similar to mixins in Ruby.
- Closures now support accessing properties of the enclosing class scope via $this.
This document discusses object-oriented programming in PHP (OOPHP). It defines OOP and procedural programming, explaining that OOP involves creating objects that contain both data and functions. The document then provides an example of defining a class in PHP with properties and methods. It demonstrates how to instantiate objects from classes, access object properties and methods, and use inheritance, constructors, and destructors in OOPHP. Finally, it outlines how to implement the model-view-controller pattern in OOPHP using classes to represent the model, view, and controller components.
DDD on example of Symfony (Webcamp Odessa 2014)Oleg Zinchenko
This document discusses Domain-Driven Design (DDD) patterns and principles using PHP and the Symfony framework as examples. It introduces key DDD concepts like the domain model, repositories, value objects, and strategies. It also outlines common layer structures and provides references to additional DDD resources.
This document discusses Wade Arnold's experience with PHP and Zend Framework. It provides an overview of Wade's background working on Zend Amf and other PHP projects. It also includes examples of file structures, models, and services that demonstrate how to build a PHP application that integrates with Flash using Zend Amf. The document advocates for using standards like Zend Framework to build robust PHP applications and services.
The document discusses unit testing Zend Framework applications. It begins by explaining the importance of testing and some common excuses for not testing. It then provides examples of setting up PHPUnit configuration and bootstrap files for testing Zend Framework applications. The document demonstrates how to write tests for Zend Forms and models, including testing with both valid and invalid data. It shows how to modify models to add validation filters and validators.
Understand how best practices apply to writing logs so that humans can read and troubleshoot errors. Using expressive and contextual messages to describe application behavior.
PT-BR
No desenvolvimento de software, é possível acumular muitas dívidas de tecnologia. Um que surge é manter os tipos primitivos (por exemplo, strings ou números) desempacotados.
Esta apresentação adapta ao GoLang Structs as vantagens de usar o padrão "Class Type Codes" do livro "Refactoring to Patterns" de Joshua Kerievsky.
---
EN
In software development, it's possible to rack up a lot of technology debt. One that comes up is to keep primitive types (for example, strings or numbers) unwrapped.
This presentation adapts to GoLang Structs the advantages of using the "Class Type Codes" pattern from the book "Refactoring to Patterns" by Joshua Kerievsky.
https://github.com/tonicospinelli/go-type-code
Em um sistema você pode acumular diversas dívidas técnicas, uma delas, que fazem os juros se acumularem é não encapsular os tipos primitivos (strings ou números) em classes. A ideia é mostrar a vantagem desse padrão abordado no livro "Refactoring to Patterns" do Joshua Kerievsky
Nos dias de hoje, o mercado de trabalho exige que sejamos profissionais, muitas vezes somos massacrados por prazos e por novas tecnologias, esteja preparado para saber lidar com isso.
Compartilhando qualidade e conhecimento com code reviewAntonio Spinelli
O documento discute o processo de code review, explicando o que é code review, por que deve ser usado e como deve ser realizado. Code review permite que o código seja revisado por outros desenvolvedores antes de ir para produção para melhorar a qualidade e compartilhar conhecimento na equipe.
Partindo de um código legado com uma organização frágil e pouco reutilizável iremos aprimorá-lo de forma incremental e com foco nas regras de negócio. Utilizaremos princípios de projeto orientado a objetos para torná-lo mais fácil de testar e reutilizar deixando o seu código mais robusto e escalável.
Ivanti’s Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There we’ll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
OpenID AuthZEN Interop Read Out - AuthorizationDavid Brossard
During Identiverse 2024 and EIC 2024, members of the OpenID AuthZEN WG got together and demoed their authorization endpoints conforming to the AuthZEN API
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
8. Globalcode – Open4education
user story
Lista de Desejos
Eu como usuário convidado, quero adicionar um produto
esgotado em minha lista de desejos para que eu receba uma
notificação quando este estiver disponível.
Objetivo
reposição mais inteligente de produtos
21. Globalcode – Open4education
php estruturado
function isValidWishList(array $data);
function getWishList(array $data);
function findAllWishProducts($email);
function addWishItem(array $data);
function removeWishItem($id);
function findAllWishlistsToNotify();
function wishlistNotified($id);
28. Globalcode – Open4education
php estruturado
Without a front controller
GET /wishlist.php?email=email@test.com
With index.php as the front controller
GET /index.php/wishlist/email@test.com
29. Globalcode – Open4education
php puro front controller
// public/index.php
// load function files
// route the request internally
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$method = $_SERVER['REQUEST_METHOD'];
if (preg_match('/wishlist/(.*)$', $uri, $matches) && $method == 'GET') {
wishlistListAction($matches[1]);
} elseif ('/index.php/wishlist/add' === $uri && $method == 'POST') {
wishlistAddAction($_GET['email'], $_POST);
} else {
header('HTTP/1.1 404 Not Found');
echo '<html><body><h1>Page Not Found</h1></body></html>';
}
37. Globalcode – Open4education
php business testes automatizados
garantem regras conhecidas
auxiliam refatoração
não evitam bugs
38. Globalcode – Open4education
php business phpunit
PHPUnit 5.4.6 by Sebastian Bergmann and contributors.
................................................... 59 / 59 (100%)
Time: 349 ms, Memory: 6.00MB
OK (59 tests, 126 assertions)
39. Globalcode – Open4education
PHPUnit 5.4.6 by Sebastian Bergmann and contributors.
..................................F................ 59 / 59 (100%)
Time: 374 ms, Memory: 6.00MB
There was 1 failure:
1) ProductTest::testUpdateProductFailed
Failed asserting that exception of type "ProductException" is
thrown.
FAILURES!
Tests: 59, Assertions: 125, Failures: 1.
php business phpunit
43. Globalcode – Open4education
php business objetos de valor
são objetos simples
encapsulam tipos primitivos
representam o valor
44. Globalcode – Open4education
class Status
{
const PENDING = 'P';
const SENT = 'S';
public function __construct($status)
{
$this->validate($status);
$this->status = $status;
}
// … other methods
public function equalsTo(Status $status)
{
return $status === $this;
}
}
php business objetos de valor
51. Globalcode – Open4education
interface WishlistRepository
{
public function find($id);
public function findAllByEmail($email);
public function add(Wishlist $wishlist);
public function delete(Wishlist $wishlist);
public function findAllToNotify();
}
php business repositórios
52. Globalcode – Open4education
namespace DevelopBusinessApplicationProductWishlistRepositories;
class PdoRepository implements WishlistRepository
{
public function __construct(PDO $driver, Factory $factory);
public function findAllByEmail($email)
{
$query = "find all items by email";
$stm = $this->driver->prepare($query);
$stm->execute([$email]);
return $stm->fetchAll(
PDO::FETCH_FUNC,
[$this->factory, 'create']
);
}
}
php business repositórios
53. Globalcode – Open4education
namespace DevelopBusinessApplicationProductWishlistRepositories;
class RedisRepository implements WishlistRepository
{
public function __construct(Predis $driver, Factory $factory);
public function find($id)
{
$wishlist = $this->driver->get($this->getKey($id));
if (!$wishlist) {
throw WishlistNotFoundException::byIdentifier($id);
}
return $this->factory->fromJson($wishlist);
}
}
php business repositórios
54. Globalcode – Open4education
class PdoRepositoryTest extends PHPUnit_Framework_TestCase
{
public function testAddNewRowSuccessful()
{
$wishlist = $this->factory->fromQueryResult(/* args */);
$pdoSpy = new PDOSpy();
(new Repository($pdoSpy))->add($wishlist);
$this->assertTrue($pdoSpy->beginTransactionCalled);
$this->assertTrue($pdoSpy->commitCalled);
$this->assertEquals(2, $wishlist->getId());
}
}
php business repositórios
55. Globalcode – Open4education
class PDOSpy extends PDO
{
public function beginTransaction()
{
$this->beginTransactionCalled = true;
}
public function prepare($statement, $options = null)
{
if ($statement == INSERT INTO wishlists VALUES (?, ?, ?)') {
return new WriteStatementStub($this->failureOnWrite);
}
throw new InvalidArgumentException(
"None Stub Statement was found for query: {$statement}"
);
}
}
php business repositórios
56. Globalcode – Open4education
function wishlistListAction($email)
{
$db = dbConnect();
$factory = new WishlistFactory();
$repository = new WishlistPdoRepository($db, $factory);
$wishlist = $repository->findAllByEmail($email);
include TEMPLATE_DIR . '/wishlists/list.php';
}
php business repositórios
72. Globalcode – Open4education
class UpdateProductUseCase
{
public function __construct($repository, $factory, $eventDispatcher);
public function execute(Intention $intention)
{
// do something
$this->repository->update($updatedProduct);
$event = new ProductWasUpdated($updatedProduct);
$this->dispatch('product.updated', $event);
if ($this->isStockIncreased($product, $updatedProduct)) {
$this->dispatch('product.stock.increased', $event);
}
return $updatedProduct;
}
}
php business eventos
73. Globalcode – Open4education
class StockListener
{
public function __construct(NotifyProductAvailable $useCase);
public function __invoke(ProductStockIncreasedEvent $event)
{
$productId = $event->getProduct()->getId();
$intention = new NotifyProductIntention($productId);
$this->useCase->execute($intention);
}
}
php business eventos
83. Globalcode – Open4education
Implementing Domain-Driven Design
by Vaughn Vernon
Patterns of Enterprise Application Architecture
by Martin Fowler
Domain-Driven Design
by Eric Evans
DDD in PHP
by Carlos Buenosvinos, Christian Soronellas and Keyvan Akbary
referências