This document summarizes the Null Object pattern. The Null Object pattern addresses how to handle null references in code elegantly. It describes replacing null references with an object that implements the necessary interface but does nothing. This simplifies code by eliminating null checks and making the relationship mandatory. The pattern is then demonstrated with an example of adding logging to a server where logging is optional. Introducing a NullLog object removes the need for null checks when writing log messages.
“Lambdas in JAVA 8 is not for what they can do, It is about how we write Program”
It enables Functional Programming, It Adds a New nucleotides in the DNA of Java.
There is a Change in “The Climate” to change our Ways.
“Lambdas in JAVA 8 is not for what they can do, It is about how we write Program”
It enables Functional Programming, It Adds a New nucleotides in the DNA of Java.
There is a Change in “The Climate” to change our Ways.
The PDF contains one of the six parts to learn Verilog in the simplest possible way.
It contains notes of first three chapters of the reference book Verilog HDL by Samir Palnitkar
Notes: Verilog Part 4- Behavioural ModellingJay Baxi
This is the 4th part of the Verilog HDL notes prepared from Verilog HDL by Samir Palnitkar .
It contains a broad view on behavioural modelling the second most frequently used level of abstraction needed for designing of sequential circuits.
chap4 : Converting and Casting (scjp/ocjp)It Academy
5.2 Given a scenario, develop code that demonstrates the
use of polymorphism. Further, determine when casting will
be necessary and recognize compiler vs. runtime errors
related to object reference casting.
7.6 Write code that correctly applies the appropriate
operators including assignment operators (limited to: =,
+ =, -=), arithmetic operators (limited to: +, -, *, /, %, ++, --),
relational operators (limited to: <,>< =, >, > =, = =, !=), the
instanceof operator, logical operators (limited to: &, |, ^, !,
&&, ||), and the conditional operator ( ? : ), to produce a
desired result. Write code that determines the equality of
two objects or two primitives.
A small presentation I developed that introduces lambda expressions and many of the common LINQ extension methods for a group of developers that were less familiar with these concepts.
The presentation consist of following:
- pimpl Idiom
- Introduction to ABC software firm – Rahul’s story.
- The SOLID Principles
- Outline of other principles : KISS , DRY , YAGNI.
- The story of a Paper- Boy : Law of Demeter
Notes: Verilog Part 5 - Tasks and FunctionsJay Baxi
The document is the penultimate part of Verilog notes out of 6 total parts.
This contains brief theoretical points on Tasks and Functions, their differences, declaration and invocation and their types and applications.
Protecting JavaScript source code using obfuscation - OWASP Europe Tour 2013 ...AuditMark
The goal of code obfuscation is to delay the understanding of what a program does. It can be used, for example, in scenarios where the code contains Intellectual Property (algorithms) or when the owner wants to prevent a competitor for stealing and reusing the code. To achieve it, an obfuscation transformation translates easy to understand code into a much harder to understand form. But in order to be resilient, obfuscation transformations need also to resist automatic reversal performed using static or dynamic code analysis techniques. This presentation focuses on the specific case of JavaScript source obfuscation, main usage cases, presents some obfuscation examples and their value in providing real protection against reverse-engineering.
Object Oriented Programming Lab Manual Abdul Hannan
Object oriented programing Lab manual for practicing and improve the coding skills of object oriented programming.
Published by Mohammad Ali Jinnah University Islamabad.
The PDF contains one of the six parts to learn Verilog in the simplest possible way.
It contains notes of first three chapters of the reference book Verilog HDL by Samir Palnitkar
Notes: Verilog Part 4- Behavioural ModellingJay Baxi
This is the 4th part of the Verilog HDL notes prepared from Verilog HDL by Samir Palnitkar .
It contains a broad view on behavioural modelling the second most frequently used level of abstraction needed for designing of sequential circuits.
chap4 : Converting and Casting (scjp/ocjp)It Academy
5.2 Given a scenario, develop code that demonstrates the
use of polymorphism. Further, determine when casting will
be necessary and recognize compiler vs. runtime errors
related to object reference casting.
7.6 Write code that correctly applies the appropriate
operators including assignment operators (limited to: =,
+ =, -=), arithmetic operators (limited to: +, -, *, /, %, ++, --),
relational operators (limited to: <,>< =, >, > =, = =, !=), the
instanceof operator, logical operators (limited to: &, |, ^, !,
&&, ||), and the conditional operator ( ? : ), to produce a
desired result. Write code that determines the equality of
two objects or two primitives.
A small presentation I developed that introduces lambda expressions and many of the common LINQ extension methods for a group of developers that were less familiar with these concepts.
The presentation consist of following:
- pimpl Idiom
- Introduction to ABC software firm – Rahul’s story.
- The SOLID Principles
- Outline of other principles : KISS , DRY , YAGNI.
- The story of a Paper- Boy : Law of Demeter
Notes: Verilog Part 5 - Tasks and FunctionsJay Baxi
The document is the penultimate part of Verilog notes out of 6 total parts.
This contains brief theoretical points on Tasks and Functions, their differences, declaration and invocation and their types and applications.
Protecting JavaScript source code using obfuscation - OWASP Europe Tour 2013 ...AuditMark
The goal of code obfuscation is to delay the understanding of what a program does. It can be used, for example, in scenarios where the code contains Intellectual Property (algorithms) or when the owner wants to prevent a competitor for stealing and reusing the code. To achieve it, an obfuscation transformation translates easy to understand code into a much harder to understand form. But in order to be resilient, obfuscation transformations need also to resist automatic reversal performed using static or dynamic code analysis techniques. This presentation focuses on the specific case of JavaScript source obfuscation, main usage cases, presents some obfuscation examples and their value in providing real protection against reverse-engineering.
Object Oriented Programming Lab Manual Abdul Hannan
Object oriented programing Lab manual for practicing and improve the coding skills of object oriented programming.
Published by Mohammad Ali Jinnah University Islamabad.
Formal treatments of inheritance are rather scarce and those that do exist are often more suited for
analysis of existing systems than as guides to language designers. One problem that adds complexity to
previous efforts is the need to pass a reference to the original invoking object throughout the method call
tree. In this paper, a novel specification of inheritance semantics is given. The approach dispenses with
self-reference, instead using static and dynamic scope to accomplish similar behaviour. The result is a
methodology that is simpler than previous specification attempts, easy to understand, and sufficiently
expressive. Moreover, an inheritance system based on this approach can be implemented with relatively
few lines of code in environment-passing interpreters.
Provide an object as a surrogate for the lack of an object of a given type. The Null Object provides intelligent do nothing behavior, hiding the details from its collaborators.
Originally written up by Bobby Wolf, in Pattern Languages of Program Design 3
C# is a great programming language for modern development. Like any language, however, there are parts of the language and BCL that can trip you up if you have invalid assumptions as to what is going on behind the scenes. This presentation discusses a few of these pitfalls and how to avoid them.
Product Derivation is a key activity in Software Product Line Engineering. During this process, derivation operators modify or create core assets (e.g., model elements, source code instructions, components) by adding, removing or substituting them according to a given configuration. The result is a derived product that generally needs to conform to a programming or modeling language. Some operators lead to invalid products when applied to certain assets, some others do not; knowing this in advance can help to better use them, however this is challenging, specially if we consider assets expressed in extensive and complex languages such as Java. In this paper, we empirically answer the following question: which product line operators, applied to which program elements, can synthesize variants of programs that are incorrect, correct or perhaps even conforming to test suites? We implement source code transformations, based on the derivation operators of the Common Variability Language. We automatically synthesize more than 370,000 program variants from a set of 8 real large Java projects (up to 85,000 lines of code), obtaining an extensive panorama of the sanity of the operations.
Paper was presented at SPLC'15
Presented at .NET South West (2024-03-26)
https://www.meetup.com/dotnetsouthwest/events/299766807/
One of the greatest shifts in modern programming practices has been how programmers across many different domains, languages and environments have embraced unit testing. Good unit testing, however, is more than waving NUnit at your C# source. Tests help to make long-term product development cost effective rather than a cost centre, they underpin the effective flow of CI/CD and reduce failure demand on a team.
But the discussion of unit testing goes further than simply writing tests: what makes a good unit test? It is not enough to have tests; poor quality tests can hold back development just as good tests can streamline it. This session provides a perspective on what good unit tests (GUTs) can look like with a couple of examples.
Presented at Agile meets Architecture (2023-10-05)
Video at https://www.youtube.com/watch?v=LLEXAdO3X1o
One of the (most overlooked) principles of the Manifesto for Agile Software Development is that "Continuous attention to technical excellence and good design enhances agility". All too often, work that focuses on addressing technical issues is deprioritised in the name of focusing on business value.
Is there a case for technical excellence — in code, in architecture, in people — beyond its appearance on a might-as-well-be-hidden page on a manifesto that's over two decades old? Is technical excellence only the concern of technical roles? Is a good architecture in conflict with business value or a vehicle for it?
This session looks to go beyond buzzwords to build a case for technical excellence that appeals to all roles in a development organisation, noting that "The best architectures, requirements, and designs emerge from self-organizing teams".
Presented online for Build Stuff meetup (https://www.buildstuff.events/events/online-build-stuff-meetup-with-kevlin-henney-and-cassandra-faris)
Whether we are talking about software architecture, coding practices or our development process, it's important to keep it real. All too often we find ourselves attracted to ideas that sound great in theory, but may not work out in practice. All too often we assume we are right — the planned release schedule, the key architectural decisions, the good practices we saw in a blog — but fail to adjust for reality. We fail to acknowledge that our knowledge was incomplete or that the situation has changed, sticking to the plan and practice regardless.
In this talk we will look at what an empirical approach to development means in practice, why it is that up-front architecture is risky and expensive, why it is that most teams who say they're doing agile development are not, and how we can use uncertainty and instability to structure our time and our code.
Presented online for C++ on Sea (2020-07-17)
Video at https://www.youtube.com/watch?v=Bai1DTcCHVE
Lambdas. All the cool kid languages have them. But does lambda mean what C++ and other languages, from Java to Python, mean by lambda? Where did lambdas come from? What were they originally for? What is their relationship to data abstraction?
In this session we will into the history, the syntax, the uses and abuses of lambdas and the way in which lambda constructs in C++ and other languages do (or do not) match the original construct introduced in lambda calculus.
Presented online for javaBin (2020-04-14)
Video at https://www.youtube.com/watch?v=orcSUE0Jjdc
Lambdas. All the cool kid languages have them. But does ‘lambda’ mean what Java, JavaScript, etc. mean by ‘lambda’? Where did lambdas come from? What were they originally for? What is their relationship to data abstraction?
In this session we will look into the history, the syntax and the uses of lambdas and the way in which lambda constructs in Java and other languages do (or do not) match the original construct introduced in lambda calculus.
Presented at DevSum (2018-05-31)
The SOLID principles are often presented as being core to good code design practice. Each of S, O, L, I and D do not, however, necessarily mean what programmers expect they mean or are taught. By understanding this range of beliefs we can learn more about practices for objects, components and interfaces than just S, O, L, I and D.
This talk reviews the SOLID principles and reveals contradictions and different interpretations. It is through paradoxes and surprises we often gain insights. We will leave SOLID somewhat more fluid, but having learnt from them more than expected.
Presented at Foo Café (2019-03-21)
Video at https://www.youtube.com/watch?v=tLSKLLxrZyY
Programmers use coding katas to kick the tyres of their programming languages, paradigms and practices. Typically anchored in a TDD cycle, katas are simple problems that give programmers the opportunity to exercise deliberate practice and explore different approaches, whether programming style, pair programming or test-first programming.
But the simplicity can be deceptive, with many programmers tiring of these katas too soon, missing out on some of the more mind-bending and paradigm-expanding opportunities on offer.
This session will pick on a couple of katas and dig deeper into TDD, lambdas, language(s), (dys)functional programming and Alcubierre drive. It will present code in a variety of languages, highlight the weaknesses of some common mantras, play around with ideas — and blend code, humour and general nerdiness to be both an enjoyable and educational session.
Procedural Programming: It’s Back? It Never Went AwayKevlin Henney
Presented at ACCU Conference 2018 (2018-04-12)
Video at https://www.youtube.com/watch?v=mrY6xrWp3Gs
When programmers describe code as 'procedural', it’s generally not meant as a compliment. There is a belief that we have collectively moved pass such thinking and onto better paradigms. But a paradigm is no more than a pattern language, a family of solutions fit for a context. Change the kind of problem you are solving and you may find a different solution makes sense — even, in these days where pure functions battle it out with classy objects, procedural programming.
This talk takes a look at some of the past, present and future of procedural programming, looking at how there’s more to it than many first assume, how it has informed and continues to influence language design and how it relates to other paradigms, such as functional and OO.
Structure and Interpretation of Test CasesKevlin Henney
Presented at ACCU Cambridge (2018-10-23)
Throw a line of code into many codebases and it's sure to hit one or more testing frameworks. There's no shortage of frameworks for testing, each with their particular spin and set of conventions, but that glut is not always matched by a clear vision of how to structure and use tests — a framework is a vehicle, but you still need to know how to drive. The computer science classic, Structure and Interpretation of Computer Programs, points out that "Programs must be written for people to read, and only incidentally for machines to execute". The same is true of test code.
This talk takes a deep dive into unit testing, looking at examples and counterexamples across a number of languages and frameworks, from naming to nesting, exploring the benefits of data-driven testing, the trade-offs between example-based and property-based testing, how to get the most out of the common given–when–then refrain and knowing how far to follow it.
Keynote present at Agile Tour Vienna (2018-10-06)
Velocity. Sprints. More points, more speed. An obsession with speed often overtakes the core values of agile software development. It’s not just development of software; it’s development of working software. Sprints are not about sprinting; they’re about sustainable pace. Time to market is less important than time in market. Full-stack development is normally a statement about technology, but it also applies to individuals and interactions. The full stack touches both the code and the world outside the code, and with that view comes responsibility and pause for thought. Doing the wrong thing smarter is not smart. The point of a team is its group intelligence not its numbers. Is scaling up the challenge, or is scaling down the real challenge? The distraction and misuse of speed, velocity, point-based systems, time, team size, scale, etc. is not the accelerant of agile development. Agility lies in experimentation, responsiveness and team intelligence.
Keynote presented at NewCrafts (2018-06-18)
Video available at https://vimeo.com/276832516
It has been said that immutability changes everything. But what does that mean in practice? What does it mean for existing code that looks more like the mutant apocalypse than an elegant application of mathematical thinking? Immutability can be an ideal that is hard to reach. Refactoring, on the other hand, is all about the art of the possible. In this talk we'll be clarifying motivation and exploring some approaches to help reducing state mutability in code.
Keynote presented at GOTO Chicago (2018-04-26)
Video available at https://www.youtube.com/watch?v=AbgsfeGvg3E
Everything is changing. Everything is new. Frameworks, platforms and trends are displaced on a weekly basis. Skills are churning.
And yet... Beneath this seemingly turbulent flow there is a slow current, strong and steady, changing relatively little over the decades. Concepts with a long history appear in new forms and fads and technologies. Principles are revisited. Ideas once lost to the mainstream are found again.
In this keynote we revisit the present through the past, looking at the enduring principles that shape programming languages, architecture, development practice and development process, the ideas that cycle round, each time becoming perhaps a little better defined, a little more mature, and look to see what else might be on the horizon.
Presented at SwanseaCon (2017-09-26)
We default to considering systems from an insider's perspective; the view from outside can be quite different. Can we apply this inversion to more than just requirements?
We may say we want testing, but what do we want from testing? We may say we want logging, but what do we want from logging? We may say we want clean code, but what do we want from clean code? We may say we want an agile process, but what do we want from an agile process? These are harder questions, but their answers can make for better solutions.
Presented at .NET South West (2017-07-25)
Code is basically made up of three things: names, spacing and punctuation. With these three tools a programmer needs to communicate intent, and not simply instruct. But if we look at most approaches to naming, they are based on the idea that names are merely labels, so that discussion of identifier naming becomes little more than a discussion of good labelling.
A good name is more than a label; a good name should change the way the reader thinks. A good name should describe structure with intention, as opposed to the affix-heavy approach common to many naming conventions in current use, where the addition of more prefixes and suffixes becomes homeopathic, diluting the meaning. Good naming is part of good design. This session looks at why and what it takes to get a good name.
Clean Coders Hate What Happens To Your Code When You Use These Enterprise Pro...Kevlin Henney
Presented at code::dive (2016-11-15)
Video available at https://www.youtube.com/watch?v=brfqm9k6qzc
It is all to easy to dismiss problematic codebases on some nebulous idea of bad practice or bad programmers. Poor code, however, is rarely arbitrary and random in its structure or formulation. Systems of code, well or poorly structured, emerge from systems of practice, whether effective or ineffective. To improve code quality, it makes more sense to pick apart the specific practices and see their interplay — the cause — than to simply focus on the code itself — the effect. This talk looks at how a handful of coding habits, design practices and assumptions can systematically balloon code and compound its accidental complexity.
Thinking Outside the Synchronisation QuadrantKevlin Henney
Presented at code::dive (2016-11-16)
Video available at https://www.youtube.com/watch?v=yl25p91flLY
Ask programmers what comes to mind when you say concurrency and most are likely to say threads. Ask what comes to mind when you say threads and most are likely to say locks or synchronisation. These assumptions are so deeply held that they define and constrain how programmers are taught and think about concurrency: thread safety is almost synonymous with the avoidance of race conditions and the guarded protection of mutable state. But this is only one quadrant of four possibilities, a quadrant diagram partitioned by mutable–immutable along one axis and shared–unshared along another. Modern C++ supports programmers in all four quadrants, not just the synchronisation quadrant. From immutability to actors, this talk will take a look at patterns and practices that encourage thinking and coding outside the locked box.
Presented at GOTO Amsterdam (2017-06-13)
Video available at https://www.youtube.com/watch?v=YyhfK-aBo-Y
What is risk? Many people aren't sure, but it's not just uncertainty: risk is exposure to uncertainty.
Instead of just plastering over the cracks, security should also involve reducing the size and number of cracks, reducing the opportunities for cracks to appear, reducing the class of errors and oversights that can open a system to failure instigated from the outside. We can learn a lot from other kinds of software failure, because every failure unrelated to security can be easily reframed as a security-failure opportunity.
This is not a talk about access control models, authentication, encryption standards, firewalls, etc. This is a talk about reducing risk that lives in the code and the assumptions of architecture, reducing the risk in development practices and in the blind spot of development practices.
Keynote presented at SATURN (2nd May 2017)
Video available at https://www.youtube.com/watch?v=MS3c9hz0bRg
"It's just a detail." Have you ever said that or been told that? Whether it's about implementation or requirements, we often use the word detail to suggest that something is not important enough to worry about. There are so many things to worry about in software development that we need to prioritize—too much detail, not enough focus. The problem is that in software, the details matter because that is what software is: lots of details brought together in combination. If we don't focus on the details, we get debt, defects, and delays.
Presented at Agile Bath & Bristol (21st March 2017)
If software development is a co-operative game, as Alistair Cockburn observed, then what kind of game is Scrum? Lots of people are playing it — or say they are — but there seems to be some disagreement about what the point of the game is, how to play it and even, in many cases, what the rules are. This talk looks at Scrum and other agile approaches through the lens of nomic games, hypothesis-driven development and fun.
Presented at the European Bioinformatics Institute (17th March 2017)
We often talk about good code — that we would like to write it, that there isn't enough of it, that it should not be considered an optional attribute of a codebase. We often talk about it but, when it comes to being precise, we don't always agree what constitutes good code, nor do we necessarily share a common view on its value.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
1. 74 Java™
Report | DE CE M BE R 199 9 http://www.java re po rt.com
I
T HAS BEEN said that in the days of punched
cards, if you wanted to find out how heavy a piece
of software was you weighed all the holes. In spite
of its apparent lack of substance, there are features
of software that make it more substantial to its users
and developers: You can develop classes, deploy
them, reuse them, etc.; you can run applications and
interact with them; you can describe software—espe-
cially software built with components and running
with objects—in very physical terms.
If you want something really insubstantial you
have to scratch the software development surface a lit-
tle deeper: What are the
successful design struc-
tures, concepts, and prac-
tices that go into making up
a system? How do you
communicate a piece of de-
sign to a colleague or ex-
press your ideas in code?
What are the benefits of one
solution over another, and
how does applying a solu-
tion affect the subsequent
design? For software, pat-
terns seem to offer a discipline based on applied
thought; naming, structuring, and communicating re-
curring solutions to problems.
In software development, the most visible popular-
ization of patterns is the Gang of Four’s (GoF) Design
Patterns catalog,1
containing 23 common design pat-
terns found in object-oriented (OO) systems. Howev-
er, these are not the only patterns, and there is a wealth
of literature produced by the patterns community that
focuses on patterns at all levels and across many dif-
ferent domains. This column is going to look beyond
the relatively familiar GoF territory, presenting other
examples that demonstrate patterns and pattern con-
cepts of use to the Java developer, as well as some re-
visits of GoF patterns from a different perspective.
So, without further ado, let’s look at a useful tacti-
cal pattern: Null Object2
is perhaps best described as
something based on nothing.
Null Object
The intent of a Null Object is to encapsulate the absence
of an object by providing a substitutable object that of-
fers suitable default, do nothing behavior. In short, a
design where, as William Shakespeare’s King Lear
would say, “nothing will come of nothing.”
Problem
Given that an object reference may optionally be null,
and that the result of a null check is to do nothing or
use a default value, how can the presence of a null be
treated transparently?
Example
Consider providing a logging facility for some kind of
simple server service that can be used to record the
outcome of operations and any significant events in
the operation of the service. One can imagine many
different kinds of log, such as a log that writes direct-
ly to the console or one that uses RMI to log a message
on a remote server. However, a server is not required
to use a log, so the association between the server and
log is optional. Figure 1 shows the relationships dia-
grammed in UML, and Listing 1 shows the Log inter-
face and two possible simple implementing classes.
In Listing 2, we can see that in using a Log object we
must always ensure that we first check it is not null, be-
cause we know it is optional, i.e., logging need not be
enabled for a service.
Forces
There is a great deal of procedural clunkiness in code,
such as:
if(log != null)
log.write(message);
This canberepetitive,aswell as errorprone:It is possible
to forget to write such a null guard, and repeated checks
for null references can clutter and obfuscate your code.
The user is required to detect the condition and
Something for nothing
Kevlin Henney is a PrincipalTechnologist with QA Training in
the UK.
KevlinHenney/ khenney@qatraining.com
Patterns in Java
*Complete references are available at Java Report Online—
www.javareport.com
2. take appropriate inaction, even though the condition is not
in any way exceptional, i.e., having a null log is a normal
and expected state of the relationship. The condition makes
the use of the logging facility less uniform.
A feature of conditional code is that it makes the deci-
sion flow of the code explicit. However, this is only a ben-
efit if the decisions taken are important to the logic of the
surrounding code; if they are not, then the resulting code is
less rather than more direct, and the core algorithm be-
comes obscured.
Where conditional code does not serve the main purpose
of a method, it tends to get in the way of the method’s own
logic, making the method longer and harder to understand.
This is especially true if the code is frequently repeated,
as one might expect from the logging facility in the exam-
ple, or if in-house coding guidelines encourage use of
blocks in preference to single statements:
if(log != null)
{
log.write(message);
}
The use of an explicit conditional means that the user may
choose alternative actions to suit the context. However, if
the action is always the same and if the optional relation-
ship is frequently used, as one might expect of logging, it
leads to duplication of the condition and its action. Dupli-
cate code is considered to have a “bad smell,”3
and works
against simple changes (fixes or other improvements).
Where the relationship is null, there is no execution cost
except a condition test and branch. On the other hand, the
use of an explicit test means that there will always be a test.
Because this test is repeated in separate pieces of code, it is
76 Java™
Report | DE CE M BE R 199 9 http://www.java re po rt.com
Patterns in Java / Kevlin Henney
Figure 1. UML class diagram of a service with optional support
for logging.
Figure 2. Key classes in a Null Object collaboration.
LI ST IN G 1...
The root Log interface and sample
concrete implementations.
public interface Log
{
void write(String messageToLog);
}
public class ConsoleLog implements Log
{
public void write(String messageToLog)
{
System.out.println(messageToLog);
}
}
public class FileLog implements Log
{
public FileLog(String logFileName)
throws IOException
{
out = new FileWriter(logFileName, true);
}
public void write(String messageToLog)
{
try
{
out.write(“[“ + new Date() + “] “ +
messageToLog + “n”);
out.flush();
}
catch(IOException ignored)
{
}
}
private final FileWriter out;
}
LIS TING 2...
Initializing and using a Log object in the Service.
public class Service
{
public Service()
{
this(null);
}
public Service(Log log)
{
this.log = log;
... // any other initialization
}
public Result handle(Request request)
{
if(log != null)
log.write(“Request “ + request + “ received”);
...
if(log != null)
log.write(“Request “ + request + “ handled”);
...
}
... // any other methods and fields
private Log log;
}
3. 78 Java™
Report | DE CE MBE R 19 9 9 http://www.java re po rt.com
Patterns in Java / Kevlin Henney
not possible to set debugging breakpoints or print state-
ments that show all uses of a null case.
Solution
Provide a class that conforms to the interface required of
the object reference, implementing all of its methods to do
nothing or provide return default values. Use an instance
of this class when the object reference would otherwise
have been null. Figure 2 shows the essential configuration
as a class model.
Resolution
Returning to the server example, we can introduce a Null
Object class, NullLog, into the Log hierarchy. Such a com-
fortably null class (see Listing 3) does nothing and does not
demand a great deal of coding skill!
The tactical benefit of a Null Object, once initialized, is in
simplifying the use of this simple logging framework. It is
now guaranteed that the relationship to a Log object is
mandatory, i.e., the multiplicity from the Service to the Log
is 1 rather than 0..1. This means that the conditional code
can be eliminated, which makes the use of logging more
uniform and the presence or absence of enabled logging
transparent (see Listing 4).
Just as the essential structure for Null Object may be dia-
grammed in UML, its use in our code can be documented in
a collaboration diagram. Figure 3 shows the classes and in-
terfaces in our design and how they correspond, in terms of
roles, to the elements outlined in Figure 2.
Consequences
Introducing a Null Object simplifies the client’s code by elim-
inating superfluous and repeated conditionals that are not
part of a method’s core logic. The relationship moves from
being optional to mandatory, and selection and variation
are expressed through polymorphism and inheritance
rather than procedural condition testing, making the use of
the relationship more uniform. However, to preserve this
invariant, care must be taken to correctly initialize the ref-
erence and to ensure either that it is not changed, i.e., de-
clare it final, or that any change preserves the requirement
that null is replaced by Null Object.
A Null Object is encapsulated and cohesive: It does one
thing—nothing—and it does it well. This eliminates du-
plicate coding, makes the (absence of) behavior easier to
reuse, and provides a suitable venue for debug breakpoints
or print statements.
The absence of side effects in any method call to Null Ob-
ject means that instances are immutable and therefore share-
able and thread-safe, so that a Null Object is a Flyweight.1
A
Null Object is typically stateless, which means that all such
instances will have the same behavior, and only one in-
stance is required, suggesting that the object might be im-
plemented as a Singleton.1
Using a Null Object in a relationship means that method
calls will always be executed and arguments will always be
evaluated. For the common case this is not a problem, but
there will always be an overhead for method calls whose
argument evaluation is complex and expensive.
The use of Null Object does not scale for distribution if
passed by reference, e.g., if it implements java.rmi.Remote.
Every method call would incur the overhead of a remote
call and introduce a potential point of failure, both of which
would swamp and undermine the basic do nothing behav-
ior. Therefore, if used in a distributed context, either null
should be passed in preference to a Null Object reference or
pass by value should be used if RMI is the distribution
mechanism, i.e., transparent replication rather than trans-
parent sharing becomes the priority. Because a Null Object
class is small and simple, class loading is cheap and the
only change the programmer needs to make is to implement
java.io.Serializable:
public class NullLog implements Log, Serializable
{
...
}
Figure 3. The relationship between the service structure and the
roles in Null Object.
LI STING 3...
A NullLog class providing do nothing behavior.
public class NullLog implements Log
{
public void write(String messageToLog)
{
}
}
LIS TING 4 ...
Introducing a NullLog object into Service.
public class Service
{
public Service()
{
this(new NullLog());
}
...
public Result handle(Request request)
{
log.write(“Request “ + request + “ received”);
...
log.write(“Request “ + request + “ handled”);
...
}
...
private Log log;
}
4. Users of a hierarchy that includes a Null Object will have more
classes to take on board. The benefit is that with the exception
of the point of creation, explicit knowledge of the new Null Ob-
ject class is not needed. Where there are many ways of doing
nothing, more Null Object classes can be introduced. Variations
on this theme include the use of an Exceptional Value object,4
that rather than doing nothing, raises an exception for any
method call or returns Exceptional Value objects as a result.
Taking an existing piece of code that does not use Null
Object and modifying it to do so may accidentally introduce
bugs. By carefully following the Introduce Null Object refac-
toring,3
developers can have greater confidence making
such changes and avoiding pitfalls. When introducing a Null
Object class into an existing system, a suitable base interface
may not exist for the Null Object class to implement. Either
that part of the system should be refactored to introduce one
or the Null Object class must subclass the concrete class re-
ferred to by the reference. The latter approach is a little un-
desirable, as it implies that if there is any representation in
the superclass it will be ignored. Such inheritance with can-
cellation can lead to code that is harder to understand be-
cause the subclass does not truly conform to the superclass,
i.e., fails the is a or is a kind of litmus test for good use of
inheritance and includes redundant implementation that
cannot be uninherited. This approach also cannot be used
if the concrete class or any of its methods are declared final.
Note that a Null Object class should not be used as a super-
class except for other Null Object classes.
Pattern Anatomy
Any pattern is a narrative, essentially a story that unfolds
with dramatis personae, the to and fro movements of the
plot elements, and a happy ending. A pattern is also a guide
to construction, telling you when and how to build some-
thing, passing on strategies, tactics, and observations from
experience. This is as true of software development patterns
as it is of building architecture where patterns originated.5,6
What You Should Find in a Pattern
A pattern identifies a general approach to solving a prob-
lem, typically capturing a solution practice or collaborative
structure. It identifies the general context of the problem,
the nature of the problem, the interplay of conflicting forces
that create the problem and binds its solution, the config-
uration that resolves the problem, and the resulting context
of applying such a solution. In short: where, what, and how
the problem arises and is solved. Rather than living in the
abstract, a pattern needs to be illustrated by something con-
crete, such as an example with code and diagrams.
Patterns also tend not to live in isolation, and so a pattern
typically contains references to other patterns that complete
it. Such links increase the value and usability of a pattern be-
cause they lay out some of the possible tracks your devel-
opment can follow, for instance, the use of Singleton with Null
Object. A pattern can also contain discussion of patterns that
are in some way similar to it or coincidentally related. How-
ever, there is a danger that a pattern written in this style can
end up as a comparative pattern study or treatise, i.e., an aca-
demic exercise rather than a piece of knowledge focused on
practice and problem solving.
Patterns are considered to be about real things, sothey are
empirical rather than theoretical, and they are about repeat-
ed rather than one-time solutions to problems. There is of-
ten an onus on pattern authors to demonstrate this, such as
by including a listing of some known uses of a pattern that
cite, for example, specific frameworks and libraries. We could
cite a number of framework examples for Null Object, as it has
been discovered time and time again, but as a general pat-
tern—as opposed to a specifically OO design pattern—it is
perhaps more common than people realize: Consider the role
of the null file device on many operating systems (/dev/null
on Unix and NUL on Microsoft systems), no-op machine in-
structions, terminators on Ethernet cables, etc.
Finally, one of the most significant parts of a pattern is
its name. The name allows us to discuss solutions easily
and at an appropriate level of abstraction. This suggests that
a pattern’s name should be drawn from the solution and
should be an evocative noun phrase7
that can be used in or-
dinary conversation, i.e., to support usage such as “if we
use a Null Object...” as opposed to “if we apply the Null Ob-
ject pattern....” It is not uncommon for a pattern to have dif-
ferent names, either because different people have
documented it at different times or because other names
have different connotations. For instance, Null Object has
also been known as Active Nothing and Smart NIL.
Pattern Form
There are many forms for documenting patterns,8
ranging
from the highly structured heading-based template form1
to more narrative, literary forms.5
The essential elements of
a pattern can be found in each form, and the choice of form
tends to be a matter of personal preference as much as any-
thing else.
A quick scan through pattern sources such as the Pat-
terns Home Page9
or the Pattern Languages of Program De -
sign (PLoPD) books10–12
should be enough to convince
anyone of the diversity of pattern form. Null Object has been
documented in a variety of forms, which vary widely in
structure and length: from the structured GoF-like form,2
to
the shorter structured form used in this column, to the brief
thumbnail-like production rule form.13
Conclusion
Patterns can quite literally help create a vocabulary for de-
velopment, accelerating communication, and the under-
standing of ideas. They are pieces of literature that capture
successful structures and practices, offering developers
reusable ideas rather than reusable code. A pattern’s form
is essentially a vehicle for conveying these.
As a specific example, Null Object illustrates how substi-
tuting a stateless object that does nothing offers a surpris-
ingly powerful solution. It can be used tactically in many
systems to encapsulate and simplify control flow—some-
thing for nothing. s
80 Java™
Report | DE CE M BE R 19 99 http://www.java re po rt.com
Patterns in Java / Kevlin Henney