Exploring the foundations of OOP and FP in PHP.
This presentation was held at MageTitans 2016 in Manchster.
It is the first time I've given this talk, I expect it to evolve over time.
Colette Cote of Pitney Bowes discusses leveraging social communications for organizational thought leadership. She outlines four steps for developing an effective thought leadership strategy: 1) take inventory of organizational assets, expertise, and values; 2) assemble unique storytelling materials across multiple channels; 3) develop conversational, socially-optimized content; and 4) iterate by monitoring, adjusting, evaluating, and engaging audiences. She provides an example of how Pitney Bowes leveraged innovation expertise through multi-channel communications, meeting with President Obama to discuss employee wellness programs. Cote believes thought leadership positions organizations as experts and the future of leveraging social communications for thought leadership is promising.
drchrono at BoxWorks Talking about Metadata API 2014drchrono
Founders of drchrono Michael Nusimow and Daniel Kivatinos at BoxWorks 2014 demoing how drchrono is leveraging the Box Metadata API.
http://www.boxworks2014.com/
------
Need a meaningful use certified EHR? No worries, we have you covered. For free.
Our team believes every physician should have access to health records on demand, wherever, whenever.
drchrono give physicians a free EHR / EMR platform with a focus on iPad, iPhone and Web.
https://drchrono.com
Presentation: The New Communications Paradigm in Financial Services: The Penn Mutual Case Study
Presented by: Joe Anthony, President, Financial Services, GregoryFCA
Join Gregory FCA and The Penn Mutual Life Insurance Company as they present a blueprint for creating a best practice communications platform in a highly socialized, networked world. Penn Mutual provides a compelling blueprint for optimizing communication among media channels, both old and new. Their success serves as a shining case study for how long-term players in financial services can benefit from all that the new paradigm offers in communications, and now offers to financial service organizations.
1) Impax reported financial results for the third quarter of 2016 with generic revenue down 3% year-over-year due to price erosion, partially offset by growth in epinephrine auto-injector and oxymorphone sales.
2) The company provided a business update on growing market share for key generic and brand products through marketing initiatives and new launches, while also facing challenges from industry-wide price declines.
3) Impax discussed its pipeline of generic opportunities and investments in research and development, focusing on expanding its central nervous system franchise and growing products like Rytary, Zomig nasal spray, and Emverm.
Colette Cote of Pitney Bowes discusses leveraging social communications for organizational thought leadership. She outlines four steps for developing an effective thought leadership strategy: 1) take inventory of organizational assets, expertise, and values; 2) assemble unique storytelling materials across multiple channels; 3) develop conversational, socially-optimized content; and 4) iterate by monitoring, adjusting, evaluating, and engaging audiences. She provides an example of how Pitney Bowes leveraged innovation expertise through multi-channel communications, meeting with President Obama to discuss employee wellness programs. Cote believes thought leadership positions organizations as experts and the future of leveraging social communications for thought leadership is promising.
drchrono at BoxWorks Talking about Metadata API 2014drchrono
Founders of drchrono Michael Nusimow and Daniel Kivatinos at BoxWorks 2014 demoing how drchrono is leveraging the Box Metadata API.
http://www.boxworks2014.com/
------
Need a meaningful use certified EHR? No worries, we have you covered. For free.
Our team believes every physician should have access to health records on demand, wherever, whenever.
drchrono give physicians a free EHR / EMR platform with a focus on iPad, iPhone and Web.
https://drchrono.com
Presentation: The New Communications Paradigm in Financial Services: The Penn Mutual Case Study
Presented by: Joe Anthony, President, Financial Services, GregoryFCA
Join Gregory FCA and The Penn Mutual Life Insurance Company as they present a blueprint for creating a best practice communications platform in a highly socialized, networked world. Penn Mutual provides a compelling blueprint for optimizing communication among media channels, both old and new. Their success serves as a shining case study for how long-term players in financial services can benefit from all that the new paradigm offers in communications, and now offers to financial service organizations.
1) Impax reported financial results for the third quarter of 2016 with generic revenue down 3% year-over-year due to price erosion, partially offset by growth in epinephrine auto-injector and oxymorphone sales.
2) The company provided a business update on growing market share for key generic and brand products through marketing initiatives and new launches, while also facing challenges from industry-wide price declines.
3) Impax discussed its pipeline of generic opportunities and investments in research and development, focusing on expanding its central nervous system franchise and growing products like Rytary, Zomig nasal spray, and Emverm.
Secure input and output handling - Meet Magento Romania 2016Anna Völkl
The document summarizes a presentation on secure input and output handling in Magento. It discusses how cross-site scripting (XSS) vulnerabilities can occur through untrusted user input and outlines steps to prevent XSS, including frontend input validation, backend input validation, and output escaping. It provides examples of validation rules and escaping functions in Magento and emphasizes the importance of validating all user input and escaping all output to help secure Magento stores from XSS and other attacks.
The document discusses four types of online healthcare professional communities: 1) consumer social media-based sites, 2) vendor-owned crowd-based communities, 3) medical organization-owned communities, and 4) manufacturer-owned communities. Each type varies in their typical uses such as awareness, market research, sentiment analysis, and building relationships with key opinion leaders. The document also differentiates communities based on contracted participation like advisory boards versus voluntary participation like association partnerships.
This document discusses service mesh for Kubernetes containers. It introduces Linkerd as a service mesh that provides features like load balancing, tracing, circuit breakers, retries, and more. It also discusses Kubernetes monitoring and logging capabilities as well as existing cluster add-ons for indexing and visualization. The document provides an overview of cloud native computing and common projects under the Cloud Native Computing Foundation, including Kubernetes for orchestration, Prometheus for monitoring, and Fluentd for logging.
This document summarizes an AWS Enterprise Summit event in Hong Kong. It provides details on the event sponsors, feedback forms for attendees, opportunities to visit booths and view customer showcases. It also outlines Alex Yung's presentation on transforming a traditional IT map to a cloud-first model. The presentation discusses starting with a project or hybrid approach, establishing a cloud center of excellence, and fully scaling workloads to AWS over multiple phases with the help of AWS services, partners, and migration tools.
The document discusses GDEPLOY 2.0, which provides deployment capabilities beyond just GlusterFS deployment. GDEPLOY 2.0 can now deploy LVM, subscription manager, yum, systemd, firewalld, shell scripts and more. Future plans include supporting containers and cloud deployments. Documentation is available online and contributions are welcome for documentation, code, and filing bugs to improve GDEPLOY. A demo is provided of using GDEPLOY to install packages on multiple nodes.
OpenStack is a proven open source software for creating private and public clouds. It is being used by a very large ecosystem of companies who use it every day to run their businesses.This talk will be an introduction to Openstack and it will cover the following:
- What is OpenStack
- Who is involved and who uses it
- Projects under the OpenStack umbrella
- OpenStack architecture(s)
- OpenStack releases
- How to contribute to OpenStack
- Q & A
This document provides an overview of OpenStack, including what it is, the main OpenStack services, and how to perform single node and multinode installations using DevStack and PackStack. OpenStack is an open-source cloud computing platform that provides infrastructure as a service. It consists of interrelated components to control hardware resources like processing, storage, and networking. The document describes the main OpenStack services like Dashboard, Compute, Networking, Object Storage, Block Storage, Image Service, Telemetry, and Orchestration. It then covers how to do a single node installation on Ubuntu, the networking requirements for multinode, and how to install and configure DevStack and PackStack for OpenStack deployment.
A few quick points for those who may be attending an OpenStack Summit for the first time. We are excited to see you in Barcelona, Spain October 25-28, 2016.
This document discusses the journey of Jitta in moving their infrastructure from self-managed servers to Google Cloud services. Some key points:
- Jitta initially deployed their application on Heroku but faced issues with slow performance and random outages.
- They then tried managing their own infrastructure but struggled to maintain all the microservices as the company grew.
- Jitta eventually migrated to Google Container Engine which provides automated scaling and management of containers, allowing their engineers to focus more on development.
- The document emphasizes that infrastructure choices need to match each startup's specific needs and cautions there is no single right solution, only lessons learned from mistakes.
Financial results for the first half of 2016 were positive for CIECH S.A.:
- Revenue grew 2.1% year-over-year and adjusted EBITDA increased 14.0% due to higher sales volumes and favorable currency exchange rates.
- The adjusted EBITDA margin expanded to 25.6% from 23.0% in the prior year period.
- For the second half of the year, CIECH S.A. expects continued implementation of investment projects and challenges from volatility in raw material prices and currency exchange rates.
How are Mage-OS packages built?
This presentation gives an overview over the history so far.
The presentation was given at MageTitans 2023 in Manchester (UK), organized by Space48.
Mage-OS is a community owned fork of Magento Open Source. It ensures the accessibility, longevity and success of the Magento platform.
These slides were shared first at Meet-Magento Romania 2021.
Developers starting to build Hyvä based Magento stores often ask "How do I use an extension that was built for a Luma theme in Hyvä?"
The answer is through compatibility modules.
Many modules already have been made compatible with Hyvä, but there are many extensions, and there will always be some that need work.
This presentation will cover the process of creating a Hyvä compatibility module and share some concrete examples from real projects.
Presentation for Meet-Magento Indonesia 2021.
It describes what the Hyvä Theme for Magento is and how it is working with it from a (mainly backend) developer perspective.
Property Based Testing is an process to build robust systems.
It facilitates a deeper understanding of the system under test. It can be used on any testing level: unit, integration or functional.
The presentation introduces how Property Based Testing works, how to use it with PHPUnit, and in what way it differentiates from example based tests.
It talks about strategies to find good properties to check for.
This presentation was built for the Meet-Magento conference 2020 in Mumbai.
The Magento 2 Certified Professional Developer exam is a lot harder than to the Magento 1 equivalent.
Many Magento 1 certified developers who enter the test expecting to pass have been disappointed.
The scenario based questions require the ability to analyze the description, and then relate it to the question and answers.
Generic OOP development principles have to be applied to the Magento 2 context.
This presentation covers the underlying principles and discusses some sample questions from the official study guide as well as some new ones. It also offers the opportunity to ask questions and discuss preparation techniques.
Attendees will get an idea of how ready they are to take the exam and how to prepare to pass the desired certification.
Working with Magento 2 UiComponents can be challenging.
This talk is about how to create and customize UiComponents without going crazy. The first part covers some general advice for writing self documenting code, the second (and in my opinion more interesting one) is about managing shared state in the view.
The slides where created for MageTitans Italy in April 2018.
A quick overview over integrating ClojureScript into the existing Magento 2 frontend.
This allows for a better developer experience compared to the default frontend components.
Secure input and output handling - Meet Magento Romania 2016Anna Völkl
The document summarizes a presentation on secure input and output handling in Magento. It discusses how cross-site scripting (XSS) vulnerabilities can occur through untrusted user input and outlines steps to prevent XSS, including frontend input validation, backend input validation, and output escaping. It provides examples of validation rules and escaping functions in Magento and emphasizes the importance of validating all user input and escaping all output to help secure Magento stores from XSS and other attacks.
The document discusses four types of online healthcare professional communities: 1) consumer social media-based sites, 2) vendor-owned crowd-based communities, 3) medical organization-owned communities, and 4) manufacturer-owned communities. Each type varies in their typical uses such as awareness, market research, sentiment analysis, and building relationships with key opinion leaders. The document also differentiates communities based on contracted participation like advisory boards versus voluntary participation like association partnerships.
This document discusses service mesh for Kubernetes containers. It introduces Linkerd as a service mesh that provides features like load balancing, tracing, circuit breakers, retries, and more. It also discusses Kubernetes monitoring and logging capabilities as well as existing cluster add-ons for indexing and visualization. The document provides an overview of cloud native computing and common projects under the Cloud Native Computing Foundation, including Kubernetes for orchestration, Prometheus for monitoring, and Fluentd for logging.
This document summarizes an AWS Enterprise Summit event in Hong Kong. It provides details on the event sponsors, feedback forms for attendees, opportunities to visit booths and view customer showcases. It also outlines Alex Yung's presentation on transforming a traditional IT map to a cloud-first model. The presentation discusses starting with a project or hybrid approach, establishing a cloud center of excellence, and fully scaling workloads to AWS over multiple phases with the help of AWS services, partners, and migration tools.
The document discusses GDEPLOY 2.0, which provides deployment capabilities beyond just GlusterFS deployment. GDEPLOY 2.0 can now deploy LVM, subscription manager, yum, systemd, firewalld, shell scripts and more. Future plans include supporting containers and cloud deployments. Documentation is available online and contributions are welcome for documentation, code, and filing bugs to improve GDEPLOY. A demo is provided of using GDEPLOY to install packages on multiple nodes.
OpenStack is a proven open source software for creating private and public clouds. It is being used by a very large ecosystem of companies who use it every day to run their businesses.This talk will be an introduction to Openstack and it will cover the following:
- What is OpenStack
- Who is involved and who uses it
- Projects under the OpenStack umbrella
- OpenStack architecture(s)
- OpenStack releases
- How to contribute to OpenStack
- Q & A
This document provides an overview of OpenStack, including what it is, the main OpenStack services, and how to perform single node and multinode installations using DevStack and PackStack. OpenStack is an open-source cloud computing platform that provides infrastructure as a service. It consists of interrelated components to control hardware resources like processing, storage, and networking. The document describes the main OpenStack services like Dashboard, Compute, Networking, Object Storage, Block Storage, Image Service, Telemetry, and Orchestration. It then covers how to do a single node installation on Ubuntu, the networking requirements for multinode, and how to install and configure DevStack and PackStack for OpenStack deployment.
A few quick points for those who may be attending an OpenStack Summit for the first time. We are excited to see you in Barcelona, Spain October 25-28, 2016.
This document discusses the journey of Jitta in moving their infrastructure from self-managed servers to Google Cloud services. Some key points:
- Jitta initially deployed their application on Heroku but faced issues with slow performance and random outages.
- They then tried managing their own infrastructure but struggled to maintain all the microservices as the company grew.
- Jitta eventually migrated to Google Container Engine which provides automated scaling and management of containers, allowing their engineers to focus more on development.
- The document emphasizes that infrastructure choices need to match each startup's specific needs and cautions there is no single right solution, only lessons learned from mistakes.
Financial results for the first half of 2016 were positive for CIECH S.A.:
- Revenue grew 2.1% year-over-year and adjusted EBITDA increased 14.0% due to higher sales volumes and favorable currency exchange rates.
- The adjusted EBITDA margin expanded to 25.6% from 23.0% in the prior year period.
- For the second half of the year, CIECH S.A. expects continued implementation of investment projects and challenges from volatility in raw material prices and currency exchange rates.
How are Mage-OS packages built?
This presentation gives an overview over the history so far.
The presentation was given at MageTitans 2023 in Manchester (UK), organized by Space48.
Mage-OS is a community owned fork of Magento Open Source. It ensures the accessibility, longevity and success of the Magento platform.
These slides were shared first at Meet-Magento Romania 2021.
Developers starting to build Hyvä based Magento stores often ask "How do I use an extension that was built for a Luma theme in Hyvä?"
The answer is through compatibility modules.
Many modules already have been made compatible with Hyvä, but there are many extensions, and there will always be some that need work.
This presentation will cover the process of creating a Hyvä compatibility module and share some concrete examples from real projects.
Presentation for Meet-Magento Indonesia 2021.
It describes what the Hyvä Theme for Magento is and how it is working with it from a (mainly backend) developer perspective.
Property Based Testing is an process to build robust systems.
It facilitates a deeper understanding of the system under test. It can be used on any testing level: unit, integration or functional.
The presentation introduces how Property Based Testing works, how to use it with PHPUnit, and in what way it differentiates from example based tests.
It talks about strategies to find good properties to check for.
This presentation was built for the Meet-Magento conference 2020 in Mumbai.
The Magento 2 Certified Professional Developer exam is a lot harder than to the Magento 1 equivalent.
Many Magento 1 certified developers who enter the test expecting to pass have been disappointed.
The scenario based questions require the ability to analyze the description, and then relate it to the question and answers.
Generic OOP development principles have to be applied to the Magento 2 context.
This presentation covers the underlying principles and discusses some sample questions from the official study guide as well as some new ones. It also offers the opportunity to ask questions and discuss preparation techniques.
Attendees will get an idea of how ready they are to take the exam and how to prepare to pass the desired certification.
Working with Magento 2 UiComponents can be challenging.
This talk is about how to create and customize UiComponents without going crazy. The first part covers some general advice for writing self documenting code, the second (and in my opinion more interesting one) is about managing shared state in the view.
The slides where created for MageTitans Italy in April 2018.
A quick overview over integrating ClojureScript into the existing Magento 2 frontend.
This allows for a better developer experience compared to the default frontend components.
This document discusses test-driven development (TDD) katas in Magento 2. It introduces the concept of code katas as a way to practice and train skills like athletes do. Specific skills trained in TDD Magento katas include the red-green-refactor process, working with test doubles, separating concerns, and testing Magento development. An example kata is provided to implement a custom "GiftItem" total model that sets prices of free gift items to zero and adjusts the subtotal. The goal is to help developers start practicing TDD with Magento through examples.
This document describes a code kata exercise for practicing test-driven development (TDD) when working with Magento 2. The kata involves test driving the total model for a sample gift item module that adds a free water bottle when a product from a specific attribute set is added to the cart. The goal is to subtract gift item totals from the subtotal and set the price of gift items to zero through TDD and the collect method of the gift item total model. Participants are instructed to check out the starting code and test drive the total model to learn TDD and Magento skills.
How to set up Magento to for running tests and basics on using the Magento 2 integration test framework.
This presentation was given at #MageTestFest in Amersfoort in on November 17th, 2017.
ClojureScript in Magento 2 - MageTitansMCR 2017vinaikopp
This document discusses using ClojureScript to build parts of Magento sites in order to avoid frustration with some of Magento's UI components. It introduces ClojureScript as a hosted LISP dialect that compiles to JavaScript and allows good interoperability with JavaScript code. The author argues that ClojureScript's features like immutability, data structures, and compiler optimizations could help developers build Magento sites more quickly and with better quality. Examples are given of how ClojureScript code interacts with JavaScript in Magento. Recommendations are made for resources to learn more about ClojureScript.
Lizards & Pumpkins Catalog Replacement at mm17devinaikopp
Lizards & Pumpkins Catalog Replacement presentation at Meet-Magento 2017 in Leipzig, Germany on 23. May 2017.
It discusses how Lizards & Pumpkins solves the problems of Performance and Scalability while avoiding the problems introduced by caching.
It also discusses how to approach customizations in an encapsulated way.
Writing Testable Code (for Magento 1 and 2) 2016 Romainavinaikopp
The latest iteration of my "Writing testable code" presentation from Meet-Magento Romaina 2016 in Cluj-Napoca.
It covers basics on what properties of production code make testing simpler.
Writing Testable Code (for Magento 1 and 2)vinaikopp
The document discusses writing testable code in Magento 1 and 2. It begins by describing assumptions and goals, such as having confidence in deployments and enjoying writing tests. It then discusses what makes code testable, including keeping classes focused on a single purpose/responsibility. The document uses an example Magento module to demonstrate refactoring code from a monolithic observer class to split it into smaller classes separated by purpose. This makes the code easier to test by isolating business logic from entry points like observers. The document advocates extracting business logic from entry points and delegating it to collaborator classes to simplify testing.
Writing testable Code (MageTitans Mini 2016)vinaikopp
How can we write code that is easy to test? This talk is not a complete reference, it just tries to list some practical advice to ease the process of getting into testing.
Getting your hands dirty testing Magento 2 (at MageTitansIT)vinaikopp
Introduction into automated testing in Magento 2 with a focus on integration tests.
The presentation was held at the MageTitans conference in Milano, Italy on 2016-02-05.
I re-uploaded a newer version of the slide deck that contains more details.
Creating software requires from us developers to make a constant stream of choices.
Each of the choices we make hopefully brings the software we are writing closer to the state of functionality it is required to have.
At the same time, each of the choices we make forms the code in a way that impacts how we can continue to work with it, how easy it is to expand and build on to, how simple it is to understand, and how many bugs we will allow to creep in.
In short, the choices we make impact the cost of development.
This talk is about development guidelines for those choices that allow us to save time and money.
Contradicting the intuitive conclusion that this means cutting corners, it actually means that we have to focus on creating programs with a high external and internal quality; that clean code pays off.
Over the years the challenge of creating modules for Magento has become less, as knowledge in the community and eco-system has grown. However, many developers, lacking other examples, still try to write modules following the practices set by the core team. This leads to modules which are tightly coupled to the Magento framework and tend to become difficult to extend, maintain and update Modern architecture allows us to create more maintainable and flexible Magento modules which might be reused more easily, for example in Magento 2.
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesQuickdice ERP
Explore the seamless transition to e-invoicing with this comprehensive guide tailored for Saudi Arabian businesses. Navigate the process effortlessly with step-by-step instructions designed to streamline implementation and enhance efficiency.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
Consistent toolbox talks are critical for maintaining workplace safety, as they provide regular opportunities to address specific hazards and reinforce safe practices.
These brief, focused sessions ensure that safety is a continual conversation rather than a one-time event, which helps keep safety protocols fresh in employees' minds. Studies have shown that shorter, more frequent training sessions are more effective for retention and behavior change compared to longer, infrequent sessions.
Engaging workers regularly, toolbox talks promote a culture of safety, empower employees to voice concerns, and ultimately reduce the likelihood of accidents and injuries on site.
The traditional method of conducting safety talks with paper documents and lengthy meetings is not only time-consuming but also less effective. Manual tracking of attendance and compliance is prone to errors and inconsistencies, leading to gaps in safety communication and potential non-compliance with OSHA regulations. Switching to a digital solution like Safelyio offers significant advantages.
Safelyio automates the delivery and documentation of safety talks, ensuring consistency and accessibility. The microlearning approach breaks down complex safety protocols into manageable, bite-sized pieces, making it easier for employees to absorb and retain information.
This method minimizes disruptions to work schedules, eliminates the hassle of paperwork, and ensures that all safety communications are tracked and recorded accurately. Ultimately, using a digital platform like Safelyio enhances engagement, compliance, and overall safety performance on site. https://safelyio.com/
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
Project Management: The Role of Project Dashboards.pdfKarya Keeper
Project management is a crucial aspect of any organization, ensuring that projects are completed efficiently and effectively. One of the key tools used in project management is the project dashboard, which provides a comprehensive view of project progress and performance. In this article, we will explore the role of project dashboards in project management, highlighting their key features and benefits.
8 Best Automated Android App Testing Tool and Framework in 2024.pdfkalichargn70th171
Regarding mobile operating systems, two major players dominate our thoughts: Android and iPhone. With Android leading the market, software development companies are focused on delivering apps compatible with this OS. Ensuring an app's functionality across various Android devices, OS versions, and hardware specifications is critical, making Android app testing essential.
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
2. Stories from
the Other Side
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
3. Exploring OOP and
Functional Programming
(to become a better programmer)
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
4. Why am I interested in this?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
5. Smart guys go FP (lambdalicious, phunkie)
The Little Schemer
Scala is the rage!
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
6. What is this, OOP + FP?
Where did these paradigms start?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
7. The term "Object Oriented Programming"
was coined by Alan Kay
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
8. Original image by Marcin Wichary - Thanks!
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
9. Amongst many other achievements,
Alan Kay created Smalltalk
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
10. "OOP to me means only messaging,
local retention and protection
and hiding of state-process,
and extreme late-binding of all things"
It can be done in Smalltalk and in LISP."
~ Alan Kay
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
11. "It can be done in Smalltalk and in LISP."
wait... WHAT?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
16. Is it about inheritance?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
17. "OOP to me means only messaging,
local retention and protection
and hiding of state-process,
and extreme late-binding of all things"
~ Alan Kay
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
18. Kay doesn't mention inheritance.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
19. Is OOP about classes?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
20. Kay doesn't mention classes either.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
21. If OOP is not about
classes or inheritance,
what is it about?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
26. Quite similar to
related Functions
within a Namespace
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
27. So OOP is about grouping methods together?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
28. "... local retention and protection ..."
~ Alan Kay
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
29. Oh yeah, objects have states.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
30. What is a state?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
31. State in class based OOP:
class Foo
{
private static $class_state = 42;
private $instance_state = -0.2;
}
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
32. State in RL is more like
public function __construct(...)
{
$this->type = 'simple';
$this->customerSession = $customerSession;
$this->scopeConfig = $scopeConfig;
$this->counter = 0;
$this->id = $_REQUEST['id'];
$this->names = $db->getNames();
}
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
33. What properties do these examples of
state have?
public function __construct(...)
{
$this->type = 'simple';
$this->customerSession = $customerSession;
$this->scopeConfig = $scopeConfig;
$this->counter = 0;
$this->id = $_REQUEST['id'];
$this->names = $db->getNames();
}
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
34. A literal
$this->type = 'simple';
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
36. Literal zero
(but looks like that might change)
$this->counter = 0;
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
37. Global state
$this->id = $_REQUEST['id'];
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
38. Stuff from the DB
$this->names = $db->getNames();
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
39. Can we partition those examples?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
40. 1. State that is always the same
2. State that might change
(within the lifespan of the object)
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
41. State that might change:
→ Counter
→ Session
→ Filesystem / DB / Internet
→ Globals
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
42. Non-changing state
→ The Type ID
→ Application State
→ Configuration
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
43. What can we do with
this information?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
46. → Don't cause any side effects
→ Given the same arguments
always return the same result
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
48. → Changing state non-local to the
function scope
→ DB or Filesystem or Network access
→ Throwing Exceptions
→ Forking
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
49. No side effects
was one part.
What was the other?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
51. A function that always returns the same
result given the same arguments is called
Referentially Transparent
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
55. → Easier to think about
(reasonability)
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
56. → Easier to break apart
(decomposability)
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
57. → Easier to combine
(composability & reuseability)
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
58. → Easier to show correctness
(testability)
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
59. → Easier to parallelize
(threadability ;))
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
60. Mkay.
But what about the
changing things?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
61. How can we deal with changing state?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
62. We treat objects as snapshots of the
state of the world in one moment.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
63. The state of the world in that
moment will never change.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
64. If change occurs, it means now is a
different moment in time.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
65. We can represent change in two ways:
→ by modifying the object
→ by creating a new instance
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
69. public function login()
{
return new self($isLoggedIn = true);
}
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
70. But what if a method
needs the
"current instance"?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
71. Either that object has to be recreated
with the current instance,
or the current instance has to be
passed as a method argument.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
74. There are more
parameters in RL!
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
75. Okay, lets reduce the argument count by
adding properties to the object.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
76. $dashboardAuthorizationManager =
new class($authorizationManager, $dashboard) {
private $authorizationManager; private $page;
public function __construct($authorizationManager, $page)
{
$this->authorizationManager = $authorizationManager;
$this->page = $page;
}
public function hasAccess($admin)
{
return $this->authorizationManager
->hasAccess($this->page, $admin);
}
}
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
77. Only one argument left:
$pageAuthorizationManager->hasAccess($loggedInAdmin);
$pageAuthorizationManager->hasAccess($loggedOutAdmin);
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
78. How might that look like in FP?
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
79. $has_access_to_dashboard =
function ($admin) use ($dashboard, $has_access) {
return $has_access($dashboard, $admin);
}
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
84. We can bundle state
and functions
without classes!
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
85. We can bundle state
and process
without classes!
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
86. Look Ma,
OOP in PHP without
hands classes!
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
87. We have the choice:
→ pass state with method arguments
→ set state as object properties
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
88. The more volatile the object state,
the more often we need to
create new instances...
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
89. ...if we want to have
Pure Functions.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
90. Lesson from FP:
Distinguish between mutable and
immutable object properties.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
91. "Mutable stateful objects are the new
spaghetti code"
~ Rich Hickey
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
93. Concepts from the FP languages can be
useful in OO PHP.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
94. We can benefit from designing our
OO code so it exhibits the properties of
pure functions.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
95. We barely scratched the surface.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
96. Don't be afraid of FP's mathematical
pattern names. It's still just code.
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
97. Building these slides I
learned something about OOP.
I hope you found it interesting, too!
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp
98. (if (has-communication? you vinai)
(communicate you vinai)
(enjoy you remaining-agenda))
MageTitans Manchester, UK - #MageTitansMCR 2016-11-12 - twitter://@VinaiKopp