# Polymorphism

An object-oriented programming concept that lets derived objects be treated as base-class objects while invoking overridden behavior based on runtime type.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Object-Oriented Programming in Python vs Java

DevFeed: [Object-Oriented Programming in Python vs Java](<https://devfeed.tech/articles/object-oriented-programming-in-python-vs-java-110727.md>)

Original publisher: [Read original article](<https://realpython.com/oop-in-python-vs-java/>)

Author: Jon Fincher

Published: 2026-10-31T14:00:00Z

Content type: comparison

Language: en

Sources: [Real Python](<https://devfeed.tech/sources/real-python.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Java](<https://devfeed.tech/topics/java.md>), [Python](<https://devfeed.tech/topics/python.md>), [class](<https://devfeed.tech/topics/class.md>), [object](<https://devfeed.tech/topics/object.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [constructor](<https://devfeed.tech/topics/constructor.md>)

Tags: [access-control](<https://devfeed.tech/tags/access-control.md>), [car](<https://devfeed.tech/tags/car.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [color](<https://devfeed.tech/tags/color.md>), [compare](<https://devfeed.tech/tags/compare.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [compilation-error](<https://devfeed.tech/tags/compilation-error.md>), [complete](<https://devfeed.tech/tags/complete.md>), [composition](<https://devfeed.tech/tags/composition.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [java](<https://devfeed.tech/tags/java.md>), [knowledge](<https://devfeed.tech/tags/knowledge.md>), [learn](<https://devfeed.tech/tags/learn.md>), [object](<https://devfeed.tech/tags/object.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [vs](<https://devfeed.tech/tags/vs.md>)

### AI overview

The article shows how Java OOP concepts translate into Python and where the languages differ. Java declares typed attributes in class bodies, commonly keeps them private behind getters and setters, and restricts classes to single inheritance while allowing shared behavior through interfaces. Python creates instance attributes with `self` in `__init__`, exposes them by default, and offers properties for controlled access; underscore naming conventions signal non-public attributes but do not provide Java-style access control. Python also supports multiple inheritance and duck typing, while Java uses interface types for polymorphic interchangeability. Both languages provide reflection and type checks, though the article describes Python's `dir()`, `getattr()`, and `callable()` workflow as simpler than Java's reflection APIs. Python dunder methods can customize representations and overload operators; the article notes Java has no comparable operator overloading. Examples use a `Car` class to illustrate these mechanisms and practical pitfalls, including class versus instance attributes.

### Source excerpt

Compare Python vs Java for object-oriented programming and learn how to apply your Java knowledge of classes and objects to Python in a Pythonic way.

## A Modern Smalltalk

DevFeed: [A Modern Smalltalk](<https://devfeed.tech/articles/a-modern-smalltalk-109142.md>)

Original publisher: [Read original article](<https://hackaday.com/2026/10/30/a-modern-smalltalk/>)

Author: Al Williams

Published: 2026-10-30T18:30:54Z

Content type: article

Language: en

Sources: [Hackaday](<https://devfeed.tech/sources/hackaday.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Squeak/Smalltalk](<https://devfeed.tech/topics/squeak.md>), [object](<https://devfeed.tech/topics/object.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [arduino](<https://devfeed.tech/tags/arduino.md>), [browser](<https://devfeed.tech/tags/browser.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [clone](<https://devfeed.tech/tags/clone.md>), [desktop](<https://devfeed.tech/tags/desktop.md>), [free](<https://devfeed.tech/tags/free.md>), [git](<https://devfeed.tech/tags/git.md>), [gnu](<https://devfeed.tech/tags/gnu.md>), [help](<https://devfeed.tech/tags/help.md>), [install](<https://devfeed.tech/tags/install.md>), [introduced](<https://devfeed.tech/tags/introduced.md>), [mvc](<https://devfeed.tech/tags/mvc.md>), [nice](<https://devfeed.tech/tags/nice.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [open](<https://devfeed.tech/tags/open.md>), [operator](<https://devfeed.tech/tags/operator.md>), [packages](<https://devfeed.tech/tags/packages.md>), [raspberry](<https://devfeed.tech/tags/raspberry.md>), [smalltalk](<https://devfeed.tech/tags/smalltalk.md>), [software-development](<https://devfeed.tech/tags/software-development.md>)

### AI overview

Cuis Smalltalk is a free, portable Smalltalk-80 environment that keeps a simple core and adds complexity through packages. It replaces the traditional MVC framework with Morphic while retaining a style familiar to users of 1990s Smalltalk. The desktop includes workspaces, help documents, and a transcript, and a class browser helps explore classes and their messages. The language treats operations such as addition as messages sent between objects, which can respond differently to the same message. Cuis uses rolling releases, though a stable release may suit application deployment. Packages for Arduino communication over a serial port exist, but they have not been updated lately and may need work.

### Source excerpt

In the history of object-oriented (OO) computer languages, Smalltalk has a special place. It wasn't the first OO language, and it hasn't spread as well as some others. But it ...read more

## Inheritance and Composition: A Python OOP Guide

DevFeed: [Inheritance and Composition: A Python OOP Guide](<https://devfeed.tech/articles/inheritance-and-composition-a-python-oop-guide-109902.md>)

Original publisher: [Read original article](<https://realpython.com/inheritance-composition-python/>)

Author: Isaac Rodriguez

Published: 2026-10-30T14:00:00Z

Content type: article

Language: en

Sources: [Real Python](<https://devfeed.tech/sources/real-python.md>)

Topics: [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Python](<https://devfeed.tech/topics/python.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [class](<https://devfeed.tech/topics/class.md>), [Learning](<https://devfeed.tech/topics/learning.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>)

Tags: [abstract-class](<https://devfeed.tech/tags/abstract-class.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code-duplication](<https://devfeed.tech/tags/code-duplication.md>), [component](<https://devfeed.tech/tags/component.md>), [components](<https://devfeed.tech/tags/components.md>), [composition](<https://devfeed.tech/tags/composition.md>), [design](<https://devfeed.tech/tags/design.md>), [guide](<https://devfeed.tech/tags/guide.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [object](<https://devfeed.tech/tags/object.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [oop](<https://devfeed.tech/tags/oop.md>), [python](<https://devfeed.tech/tags/python.md>), [relationships](<https://devfeed.tech/tags/relationships.md>)

### AI overview

Inheritance models an "is a" relationship and reuses a base class's interface and implementation; composition models a "has a" relationship, combining objects while keeping their classes more loosely coupled. The excerpt illustrates inheritance with employee types sharing payroll behavior, and shows how expanding roles and pay policies can create large hierarchies. Multiple inheritance can introduce method resolution order and diamond problems that require explicit handling. The composition design instead gives employees separate role and payroll policy objects, so behaviors can be combined or changed without multiplying employee subclasses. The excerpt also covers Python's implicit inheritance from `object`, abstract base classes, and duck typing: a payroll system can accept any object providing the attributes and method it uses. The supplied text ends during the composition example, so its later implementation and conclusions are not available.

### Source excerpt

Learn how inheritance and composition in Python model is-a and has-a relationships, and when to use each to design flexible object-oriented code.

## CodeSOD: A Type of Type Safety

DevFeed: [CodeSOD: A Type of Type Safety](<https://devfeed.tech/articles/codesod-a-type-of-type-safety-85187.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/a-type-of-type-safety>)

Author: Remy Porter

Published: 2026-10-12T06:30:00Z

Content type: article

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [typesafety](<https://devfeed.tech/topics/typesafety.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [code](<https://devfeed.tech/tags/code.md>), [codesod](<https://devfeed.tech/tags/codesod.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [type-safety](<https://devfeed.tech/tags/type-safety.md>), [type-system](<https://devfeed.tech/tags/type-system.md>)

### AI overview

The article critiques a C++ codebase that uses runtime type checks and casts to restrict behavior based on object types. It explains how this approach misuses C++ casting and contrasts it with using polymorphism and dynamic dispatch to model the domain.

### Source excerpt

For some godawful reason, people like to explain object oriented concepts via analogy to biological taxonomies. I suppose it's easy to understand an "is-a" relationship (a cat is a mammal), but the down side is you get a complex and increasingly leaky analogy that over-emphasizes the importance of inheritance. That's not to slight Alan's choice of using it to anoymize today's code. It's just a broad frustration on my part. In any case, Alan has been working in a C++ codebase that's written by people who maybe don't fully understand all the key object oriented concepts. That's why you get code like this: /* * If possible, steal tentacle from the given animal. */ void Animal::StealTentacle(Animal *animal) { // only Octopus and Squid can have tentacles if (!IS_INSTANCE_OF(this, Octopus) && !IS_INSTANCE_OF(this, Squid)) { return; } Limb *limb = animal->mLimbs->GetFirstTentacle(); if (limb) { limb->AttachToAnimal(this); // . . . This function takes a raw pointer to an Animal object. If that pointer is not an Octopus or a Squid, we bail. Otherwise, we're going to take its tentacle, and do stuff with it. Now, this is a pretty clear example of the type switch anti-pattern. Instead of using the type system and polymorphism to enforce restrictions, we instead do runtime type checks. But wait a second, what's going on in that IS_INSTANCE_OF? // I've noticed that dynamic_cast always returns a valid result when // casting an "objectPointer" of type "className". // Try casting it to a [Organism *] to force it to work. (?) #define IS_INSTANCE_OF(objectPointer, className) ((bool) (dynamic_cast<className *>(((Organism *) objectPointer)) != NULL)) #define IS_MEMBER_OF(objectPointer, className) IS_INSTANCE_OF(objectPointer, className) // temporary macro alias This code attempts to take an objectPointer and first, force it into a pointer to our base type (Organism), using a C-style cast. Now, in C++, C-style casts are a shorthand, and the compiler will, based on the context, attempt to

## The Art of Object-Oriented Programming

DevFeed: [The Art of Object-Oriented Programming](<https://devfeed.tech/articles/the-art-of-object-oriented-programming-64579.md>)

Original publisher: [Read original article](<https://hackernoon.com/the-art-of-object-oriented-programming?source=rss>)

Author: Syed Ahmer Shah

Published: 2026-10-04T11:53:47Z

Content type: tutorial

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [solid principles](<https://devfeed.tech/topics/solid-principles.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [class](<https://devfeed.tech/topics/class.md>), [object](<https://devfeed.tech/topics/object.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>)

Tags: [common-oop-design-mistakes](<https://devfeed.tech/tags/common-oop-design-mistakes.md>), [composition](<https://devfeed.tech/tags/composition.md>), [composition-over-inheritance](<https://devfeed.tech/tags/composition-over-inheritance.md>), [coupling](<https://devfeed.tech/tags/coupling.md>), [coupling-and-cohesion-in-oop](<https://devfeed.tech/tags/coupling-and-cohesion-in-oop.md>), [design-patterns](<https://devfeed.tech/tags/design-patterns.md>), [four-pillars-of-oop](<https://devfeed.tech/tags/four-pillars-of-oop.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [oop-design-principles](<https://devfeed.tech/tags/oop-design-principles.md>), [oop-principles](<https://devfeed.tech/tags/oop-principles.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

A practical tutorial explains object-oriented programming through classes, objects, state, behavior, encapsulation, abstraction, inheritance, and polymorphism. It compares composition with inheritance and discusses association, aggregation, coupling, cohesion, and common design mistakes, using code examples to show how responsibilities can be separated in a software system.

### Source excerpt

Understand OOP from classes and objects to composition, inheritance, polymorphism, coupling, and cohesion with practical examples.

## Object-Oriented Programming (OOP) in Python

DevFeed: [Object-Oriented Programming (OOP) in Python](<https://devfeed.tech/articles/object-oriented-programming-oop-in-python-60468.md>)

Original publisher: [Read original article](<https://realpython.com/python3-object-oriented-programming/>)

Author: David Amos

Published: 2026-09-26T14:00:00Z

Content type: tutorial

Language: en

Sources: [Real Python](<https://devfeed.tech/sources/real-python.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Python](<https://devfeed.tech/topics/python.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [object](<https://devfeed.tech/topics/object.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [oop](<https://devfeed.tech/tags/oop.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

This tutorial introduces object-oriented programming in Python, explaining how classes define objects and how objects group data with methods. It covers inheritance, encapsulation, abstraction, polymorphism, and creating instances from classes.

### Source excerpt

Learn object-oriented programming in Python: the OOP paradigm, classes and inheritance, and how to instantiate objects from a class.

## Modern App Protection Requires Polymorphism | Guardsquare

DevFeed: [Modern App Protection Requires Polymorphism | Guardsquare](<https://devfeed.tech/articles/modern-app-protection-requires-polymorphism-guardsquare-26311.md>)

Original publisher: [Read original article](<https://www.guardsquare.com/blog/polymorphic-mobile-app-protection>)

Author: Jason Cortlund - Technical Marketing Writer

Published: 2026-08-18T13:45:43Z

Content type: article

Language: en

Sources: [Guardsquare](<https://devfeed.tech/sources/guardsquare-blog.md>)

Topics: [Mobile](<https://devfeed.tech/topics/mobile.md>), [Mobile Security](<https://devfeed.tech/topics/mobile-security.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [Security](<https://devfeed.tech/topics/security.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>)

Tags: [agentic-ai](<https://devfeed.tech/tags/agentic-ai.md>), [ai](<https://devfeed.tech/tags/ai.md>), [development](<https://devfeed.tech/tags/development.md>), [dexguard](<https://devfeed.tech/tags/dexguard.md>), [ixguard](<https://devfeed.tech/tags/ixguard.md>), [large-language-models-llms](<https://devfeed.tech/tags/large-language-models-llms.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [protection](<https://devfeed.tech/tags/protection.md>), [reverse-engineering](<https://devfeed.tech/tags/reverse-engineering.md>), [security](<https://devfeed.tech/tags/security.md>), [security-research](<https://devfeed.tech/tags/security-research.md>), [thought-leadership](<https://devfeed.tech/tags/thought-leadership.md>), [vulnerabilities](<https://devfeed.tech/tags/vulnerabilities.md>)

### AI overview

The article argues that mobile app protection should use polymorphism, with protections changing for each application build. It links this approach to the risks created by development speed, AI-generated code, and scalable reverse-engineering attacks.

### Source excerpt

According to credit reporting agency Equifax, "...mobile app security is often neglected by developers -- making apps more vulnerable to fraud." The reason for this is quite simple for most organizations: development speed is the dominant priority. In fact, 79% of mobile developers cite time-to-market pressure as the top barrier to stronger protection.

## SpectrePaste: An AI-Assisted, Fileless PowerShell Malware Delivery System

DevFeed: [SpectrePaste: An AI-Assisted, Fileless PowerShell Malware Delivery System](<https://devfeed.tech/articles/spectrepaste-22546.md>)

Original publisher: [Read original article](<https://medium.com/walmartglobaltech/spectrepaste-b20bc2f6ded8?source=rss----905ea2b3d4d1---4>)

Author: Joshua Platt

Published: 2026-07-06T18:54:30Z

Content type: article

Language: en

Sources: [Walmart Global Tech](<https://devfeed.tech/sources/walmart-global-tech.md>)

Topics: [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Malware](<https://devfeed.tech/topics/malware.md>), [Threat Research](<https://devfeed.tech/topics/threat-research.md>), [PowerShell](<https://devfeed.tech/topics/powershell.md>), [C2](<https://devfeed.tech/topics/c2.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [Encryption](<https://devfeed.tech/topics/encryption.md>), [Resilience](<https://devfeed.tech/topics/resilience.md>), [Routing (disambiguation)](<https://devfeed.tech/topics/routing.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [Spec Driven Development](<https://devfeed.tech/topics/spec-driven-development.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [artificial-intelligence](<https://devfeed.tech/tags/artificial-intelligence.md>), [backend](<https://devfeed.tech/tags/backend.md>), [c2](<https://devfeed.tech/tags/c2.md>), [cache](<https://devfeed.tech/tags/cache.md>), [cybersecurity](<https://devfeed.tech/tags/cybersecurity.md>), [detection-engineering](<https://devfeed.tech/tags/detection-engineering.md>), [encryption](<https://devfeed.tech/tags/encryption.md>), [malware](<https://devfeed.tech/tags/malware.md>), [malware-analysis](<https://devfeed.tech/tags/malware-analysis.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [powershell](<https://devfeed.tech/tags/powershell.md>), [resilience](<https://devfeed.tech/tags/resilience.md>), [routing](<https://devfeed.tech/tags/routing.md>), [spec-driven-development](<https://devfeed.tech/tags/spec-driven-development.md>), [threat-intelligence](<https://devfeed.tech/tags/threat-intelligence.md>)

### AI overview

The article describes SpectrePaste, a previously undocumented fileless malware delivery system that threat actors used with AI as its primary orchestrator and developer. Its early architecture included automated AMSI-bypass generation, XOR-encrypted payloads, resilient command-and-control traffic handling, caching, request queuing, and administrative priority routing.

### Source excerpt

by Joshua Platt and Jason Reaves [TLP:CLEAR] Earlier this year, Google Threat Intelligence[1] reported threat actors are increasingly deploying novel, AI-enabled malware in active operations[2]. While investigating a recent OSINT article[3] on malware campaign activity reported as "DeepLoad", our threat intelligence team identified a separate, previously undocumented fileless delivery system we track as "SpectrePaste". The prior public reporting correctly suspected AI involvement in the "DeepLoad" delivery chain, but our analysis reveals a more conclusive and concerning reality. AI did not just play a supporting role. It acted as the primary orchestrator and developer behind the entire SpectrePaste system. Threat actors internally referred to the early system as "PasteFast Panel." In this initial iteration, the system was highly modular, structured, and designed specifically for resilience against high-volume bot traffic. One of the hallmarks of automated, AI-assisted development. The early architecture functioned as a centralized PowerShell payload delivery system with several notable features: Automated Evasion Generation: The paste builder module automatically prepended Anti-Malware Scan Interface (AMSI) bypass scripts to payloads upon creation, followed by XOR encryption using a custom obfuscator template. This ensured every payload served was dynamically packed. C2 Resilience & High-Load Handling: The most sophisticated feature of the early version was its custom cache manager queue system. The threat actors anticipated massive, simultaneous beaconing from compromised hosts. To prevent database exhaustion, the panel featured an automated threshold toggle. During traffic spikes, the system queued requests, cached the encrypted payloads in memory, and deduplicated IP addresses to ensure a single infected bot could not inadvertently DDoS the command server. Admin Priority Routing: Developer requirements explicitly prioritized operator access. Administrative routes

## Managing Multi Table Inserts With Room

DevFeed: [Managing Multi Table Inserts With Room](<https://devfeed.tech/articles/managing-multi-table-inserts-with-room-22825.md>)

Original publisher: [Read original article](<http://androidessence.com/multi-table-inserts/>)

Author: Adam McNeilly

Published: 2026-04-25T00:00:00Z

Content type: article

Language: en

Sources: [Android Essence](<https://devfeed.tech/sources/android-essence.md>)

Topics: [Database](<https://devfeed.tech/topics/database.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [interface](<https://devfeed.tech/topics/interface.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [database](<https://devfeed.tech/tags/database.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [oop](<https://devfeed.tech/tags/oop.md>)

### AI overview

This article explains how to handle multi-table inserts in Room when entities have nested dependencies. It first considers separate DAO interfaces and a wrapper class, then shows how interface inheritance can centralize insertion logic and let dependent DAOs reuse it.

### Source excerpt

A properly relational database may have a type that appears referenced multiple times. In my SpaceNerd playground app, that is the Country object. An Agency has a country, and an Agency is a dependency of a Launch, of a Space Station, and likely more types to come. How do I enforce that any time I insert an Agency, I also insert the Countries associated with it? That's what this blog post sets out to explore, and the answer is much simpler than I thought when I started.

## Object Oriented Programming - The Key Terms

DevFeed: [Object Oriented Programming - The Key Terms](<https://devfeed.tech/articles/object-oriented-programming-the-key-terms-34688.md>)

Original publisher: [Read original article](<https://newsletter.systemdesigncodex.com/p/object-oriented-programming-the-key>)

Author: Saurabh Dashora

Published: 2026-03-24T08:38:43Z

Content type: article

Language: en

Sources: [System Design Codex](<https://devfeed.tech/sources/system-design-codex.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [interface](<https://devfeed.tech/topics/interface.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [concepts](<https://devfeed.tech/tags/concepts.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [maintainability](<https://devfeed.tech/tags/maintainability.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [programming](<https://devfeed.tech/tags/programming.md>), [security](<https://devfeed.tech/tags/security.md>)

### AI overview

This tutorial introduces object-oriented programming through four principles: abstraction, encapsulation, inheritance, and polymorphism. It explains how abstraction hides implementation details, encapsulation controls access to data and methods, and inheritance supports reuse and hierarchical relationships. The supplied text begins its discussion of polymorphism but is truncated.

### Source excerpt

The essential concepts

## Deriving Type Erasure

DevFeed: [Deriving Type Erasure](<https://devfeed.tech/articles/deriving-type-erasure-60973.md>)

Original publisher: [Read original article](<https://david.alvarezrosa.com/posts/deriving-type-erasure/>)

Author: David Álvarez Rosa

Published: 2026-03-10T09:46:00Z

Content type: tutorial

Language: en

Sources: [David Álvarez Rosa](<https://devfeed.tech/sources/david-alvarez-rosa.md>)

Topics: [union types](<https://devfeed.tech/topics/union-types.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [cpp](<https://devfeed.tech/tags/cpp.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

The tutorial explains type erasure in C++ by comparing interface-based polymorphism with templates. It introduces wrappers that can provide a shared interface for concrete types that do not share a base class, deriving a minimal std::any implementation.

### Source excerpt

Ever looked at std::any and wondered what's going on behind the scenes? Beneath the intimidating interface is a classic technique called type erasure: concrete types hidden behind a small, uniform wrapper. Starting from familiar tools like virtual functions and templates, we'll build a minimal std::any. By the end, you'll have a clear understanding of how type erasure works under the hood. Polymorphism with interfaces § The typical way to achieve polymorphism is to define an interface consisting of pure-virtual methods you want to be able to call. Then, for each implementation that you want to use polymorphically, you create a subclass that inherits from the base class and implement those methods. As an example, let's implement shape classes that have an area() method. We start with an interface1 class class Shape { public: virtual ~Shape() = default; virtual auto area() const noexcept -> double = 0; }; And add a couple of concrete implementations for Square and Circle class Square : public Shape { int side_; public: explicit Square(int side) noexcept : side_{side} {} auto area() const noexcept -> double override { return side_ * side_; } }; class Circle : public Shape { int radius_; public: explicit Circle(int radius) noexcept : radius_{radius} {} auto area() const noexcept -> double override { return std::numbers::pi * radius_ * radius_; } }; Now, we can use these implementations generically, by coding against the interface auto printArea(const Shape& shape) -> void { std::println("Area is {:.2f}", shape.area()); } Simple enough, right? Polymorphism with templates § Inheritance is a good solution to problems that require polymorphism, but sometimes the concrete types you want to handle polymorphically cannot share a common base class.2 In that case, if the types provide the same interface, you can use a template to get polymorphism instead auto printArea(const auto& shape) -> void { std::println("Area is {:.2f}", shape.area()); } You can use this method with Squar

## Devirtualization and Static Polymorphism

DevFeed: [Devirtualization and Static Polymorphism](<https://devfeed.tech/articles/devirtualization-and-static-polymorphism-60974.md>)

Original publisher: [Read original article](<https://david.alvarezrosa.com/posts/devirtualization-and-static-polymorphism/>)

Author: David Álvarez Rosa

Published: 2026-02-25T09:45:00Z

Content type: tutorial

Language: en

Sources: [David Álvarez Rosa](<https://devfeed.tech/sources/david-alvarez-rosa.md>)

Topics: [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [Compilers and Linkers](<https://devfeed.tech/topics/compilers-and-linkers.md>), [inlining](<https://devfeed.tech/topics/inlining.md>)

Tags: [compilation](<https://devfeed.tech/tags/compilation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compiler-flags](<https://devfeed.tech/tags/compiler-flags.md>), [cpp](<https://devfeed.tech/tags/cpp.md>), [inlining](<https://devfeed.tech/tags/inlining.md>), [performance](<https://devfeed.tech/tags/performance.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>)

### AI overview

The article explains how virtual dispatch can add pointer indirection, increase object size, and limit inlining. It describes compiler devirtualization and cross-translation-unit optimization, then recommends static polymorphism for latency-sensitive paths to reduce runtime dispatch cost.

### Source excerpt

Ever wondered why your "clean" polymorphic design underperforms in benchmarks? Virtual dispatch enables polymorphism, but it comes with hidden overhead: pointer indirection, larger object layouts, and fewer inlining opportunities. Compilers do their best to devirtualize these calls, but it isn't always possible. On latency-sensitive paths, it's beneficial to manually replace dynamic dispatch with static polymorphism, so calls are resolved at compile time and the abstraction has effectively zero runtime cost. Virtual dispatch § Runtime polymorphism occurs when a base interface exposes a virtual method that derived classes override. Calls made through a Base& are then dispatched to the appropriate override at runtime. Under the hood, a virtual table (vtable) is created for each class, and a pointer (vptr) to the vtable is added to each instance. Figure 1: Virtual dispatch diagram. The method foo is declared virtual in Base and overridden in Derived. Both classes get a vtable, and each object gets a vptr pointing to the corresponding vtable. On a virtual call, the compiler loads the vptr, selects the right slot in the vtable, and performs an indirect call through that function pointer. The drawback is that the extra vptr increases object size, and the indirection through the vtable makes the call hard to predict. This prevents inlining, increases branch mispredictions, and reduces cache efficiency. The best way to observe this phenomenon is by inspecting the assembly1 code emitted by the compiler for a minimal example class Base { public: auto foo() -> int; }; auto bar(Base* base) -> int { return base->foo() + 77; } For a non-virtual member function foo like in the example above, the free function bar issues a direct call bar(Base*): sub rsp, 8 call Base::foo() // Direct call add rsp, 8 add eax, 77 ret However, declaring foo as virtual changes bar's assembly into an indirect, vtable-based call bar(Base*): sub rsp, 8 mov rax, QWORD PTR [rdi] // vptr (pointer to vtable)

## two mechanisms for dynamic type checks

DevFeed: [two mechanisms for dynamic type checks](<https://devfeed.tech/articles/two-mechanisms-for-dynamic-type-checks-35030.md>)

Original publisher: [Read original article](<https://wingolog.org/archives/2026/02/18/two-mechanisms-for-dynamic-type-checks>)

Author: Andy Wingo

Published: 2026-02-18T16:21:10Z

Content type: tutorial

Language: en

Sources: [wingolog](<https://devfeed.tech/sources/wingolog.md>)

Topics: [virtual machines](<https://devfeed.tech/topics/virtual-machines.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [WebAssembly](<https://devfeed.tech/topics/web-assembly.md>), [JIT](<https://devfeed.tech/topics/jit.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [cardelli](<https://devfeed.tech/tags/cardelli.md>), [cohen](<https://devfeed.tech/tags/cohen.md>), [dfs](<https://devfeed.tech/tags/dfs.md>), [display-hack](<https://devfeed.tech/tags/display-hack.md>), [dybvig](<https://devfeed.tech/tags/dybvig.md>), [scheme](<https://devfeed.tech/tags/scheme.md>), [vitek](<https://devfeed.tech/tags/vitek.md>), [wasm](<https://devfeed.tech/tags/wasm.md>), [webassembly](<https://devfeed.tech/tags/webassembly.md>)

### AI overview

This technical note explains two mechanisms for dynamic instance type checks in virtual machines with single inheritance. It describes DFS numbering when the type set is fixed and the display hack, based on per-type supertype arrays, when types can be added at run time.

### Source excerpt

Today, a very quick note on dynamic instance type checks in virtual machines with single inheritance. The problem is that given an object o whose type is t, you want to check if o actually is of some more specific type u. To my knowledge, there are two sensible ways to implement these type checks. if the set of types is fixed: dfs numbering Consider a set of types T := {t, u, ...} and a set of edges S := {<t|ε, u>, ...} indicating that t is the direct supertype of u, or ε if u is a top type. S should not contain cycles and is thus a direct acyclic graph rooted at ε. First, compute a pre-order and post-order numbering for each t in the graph by doing a depth-first search over S from ε. Something like this: def visit(t, counter): t.pre_order = counter counter = counter + 1 for u in S[t]: counter = visit(u, counter) t.post_order = counter return counter Then at run-time, when making an object of type t, you arrange to store the type's pre-order number (its tag) in the object itself. To test if the object is of type u, you extract the tag from the object and check if tag-u.pre_order mod 2n < u.post_order-u.pre_order. Two notes, probably obvious but anyway: one, you know the numbering for u at compile-time and so can embed those variables as immediates. Also, if the type has no subtypes, it can be a simple equality check. Note that this approach applies only if the set of types T is fixed. This is the case when statically compiling a WebAssembly module in a system that doesn't allow modules to be instantiated at run-time, like Wastrel. Interestingly, it can also be the case in JIT compilers, when modeling types inside the optimizer. if the set of types is unbounded: the display hack If types may be added to a system at run-time, maintaining a sorted set of type tags may be too much to ask. In that case, the standard solution is something I learned of as the display hack, but whose name is apparently ungooglable. It is described in a 4-page technical note by Norman H. Coh

## San Diego C++ Meetup #83: February 2026 Edition

DevFeed: [San Diego C++ Meetup #83: February 2026 Edition](<https://devfeed.tech/articles/san-diego-c-meetup-83-february-2026-edition-51144.md>)

Original publisher: [Read original article](<https://vorbrodt.blog/2026/02/11/san-diego-c-meetup-83-february-2026-edition/>)

Author: Kobi

Published: 2026-02-12T02:58:57Z

Content type: article

Language: en

Sources: [Vorbrodt's C++ Blog](<https://devfeed.tech/sources/vorbrodt-s-c-blog.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [Collections](<https://devfeed.tech/topics/collections.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [announcement](<https://devfeed.tech/tags/announcement.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [community](<https://devfeed.tech/tags/community.md>), [deep-dive](<https://devfeed.tech/tags/deep-dive.md>), [detection](<https://devfeed.tech/tags/detection.md>), [developers](<https://devfeed.tech/tags/developers.md>), [kobi](<https://devfeed.tech/tags/kobi.md>), [meetup](<https://devfeed.tech/tags/meetup.md>), [san-diego](<https://devfeed.tech/tags/san-diego.md>), [san-diego-c-plus-plus-meetup](<https://devfeed.tech/tags/san-diego-c-plus-plus-meetup.md>), [technical](<https://devfeed.tech/tags/technical.md>)

### AI overview

A recap of the 83rd San Diego C++ Meetup covering a presentation on hidden dangers in static polymorphism, including object slicing with CRTP and std::tuple. It also describes safer modern C++ approaches such as concepts, std::variant, std::visit, std::apply, and variadic templates, alongside the community's move from Meetup.com to Luma.

### Source excerpt

Last night we held our 83rd San Diego C++ Meetup. It was a fantastic evening filled with deep technical discussions and a significant announcement regarding the future of our community infrastructure. The Big Announcement: Moving to Luma The biggest news from this meeting is that we are officially moving away from Meetup.com. To streamline our [...]

## Class Pollution in Ruby: A Deep Dive into Exploiting Recursive Merges

DevFeed: [Class Pollution in Ruby: A Deep Dive into Exploiting Recursive Merges](<https://devfeed.tech/articles/class-pollution-in-ruby-a-deep-dive-into-exploiting-recursive-merges-92053.md>)

Original publisher: [Read original article](<https://blog.doyensec.com/2024/10/02/class-pollution-ruby.html>)

Published: 2024-10-01T22:00:00Z

Content type: article

Language: en

Sources: [Doyensec](<https://devfeed.tech/sources/doyensec.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [class](<https://devfeed.tech/topics/class.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [superclass](<https://devfeed.tech/topics/superclass.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [about](<https://devfeed.tech/tags/about.md>), [admin](<https://devfeed.tech/tags/admin.md>), [allows](<https://devfeed.tech/tags/allows.md>), [alter](<https://devfeed.tech/tags/alter.md>), [application](<https://devfeed.tech/tags/application.md>), [auditing](<https://devfeed.tech/tags/auditing.md>), [automation](<https://devfeed.tech/tags/automation.md>), [base](<https://devfeed.tech/tags/base.md>), [based](<https://devfeed.tech/tags/based.md>), [behavior](<https://devfeed.tech/tags/behavior.md>), [behaviors](<https://devfeed.tech/tags/behaviors.md>), [blog](<https://devfeed.tech/tags/blog.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [can](<https://devfeed.tech/tags/can.md>), [cases](<https://devfeed.tech/tags/cases.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [deep](<https://devfeed.tech/tags/deep.md>), [deep-dive](<https://devfeed.tech/tags/deep-dive.md>), [dive](<https://devfeed.tech/tags/dive.md>), [doyensec](<https://devfeed.tech/tags/doyensec.md>), [doyensecurity](<https://devfeed.tech/tags/doyensecurity.md>), [exploit](<https://devfeed.tech/tags/exploit.md>), [hacking](<https://devfeed.tech/tags/hacking.md>), [infosec](<https://devfeed.tech/tags/infosec.md>), [offensive](<https://devfeed.tech/tags/offensive.md>), [pentest](<https://devfeed.tech/tags/pentest.md>), [pentester](<https://devfeed.tech/tags/pentester.md>), [pollution](<https://devfeed.tech/tags/pollution.md>), [reverse-engineering](<https://devfeed.tech/tags/reverse-engineering.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [security](<https://devfeed.tech/tags/security.md>), [vulnerability](<https://devfeed.tech/tags/vulnerability.md>)

### AI overview

Recursive merges that assign data to Ruby object attributes can alter behavior beyond the supplied values, and recursive traversal can escape an object to affect parent or unrelated classes. The article distinguishes hash-only merges, which it says cannot pollute classes, from nonrecursive attribute merges, which affect one object, and recursive attribute merges, which can have broader effects. Its example shows instance-level method injection enabling privilege escalation or code execution when protected methods are evaluated. ActiveSupport's `deep_merge` works on hashes and becomes risky in the article's example when merged values are then assigned as object attributes. Hashie merges object attributes and blocks direct method replacement, but the article describes an exception involving the `_` attribute that can bypass an authorization check. Further examples demonstrate poisoning a parent class variable to redirect HTTP requests and repeatedly targeting subclasses to alter a signing key; the latter is random and may over-infect classes. The article concludes that recursive merges of untrusted data can compromise application behavior across requests.

### Source excerpt

Introduction In this post, we are going to explore a rarely discussed class of vulnerabilities in Ruby, known as class pollution. This concept is inspired by the idea of prototype pollution in JavaScript, where recursive merges are exploited to poison the prototype of objects, leading to unexpected behaviors. This idea was initially discussed in a blog post about prototype pollution in Python, in which the researcher used recursive merging to poison class variables and eventually global variables via the __globals__ attribute. In Ruby, we can categorize class pollution into three main cases: Merge on Hashes: In this scenario, class pollution isn't possible because the merge operation is confined to the hash itself. Merge on Attributes (Non-Recursive): Here, we can poison the instance variables of an object, potentially replacing methods by injecting return values. This pollution is limited to the object itself and does not affect the class. current_obj.instance_variable_set("@#{key}", new_object) current_obj.singleton_class.attr_accessor key Merge on Attributes (Recursive): In this case, the recursive nature of the merge allows us to escape the object context and poison attributes or methods of parent classes or even unrelated classes, leading to a broader impact on the application. Merge on Attributes Let's start by examining a code example where we exploit a recursive merge to modify object methods and alter the application's behavior. This type of pollution is limited to the object itself. require 'json' # Base class for both Admin and Regular users class Person attr_accessor :name, :age, :details def initialize(name:, age:, details:) @name = name @age = age @details = details end # Method to merge additional data into the object def merge_with(additional) recursive_merge(self, additional) end # Authorize based on the `to_s` method result def authorize if to_s == "Admin" puts "Access granted: #{@name} is an admin." else puts "Access denied: #{@name} is not an adm

## Sealed classes and interfaces in Kotlin

DevFeed: [Sealed classes and interfaces in Kotlin](<https://devfeed.tech/articles/sealed-classes-and-interfaces-in-kotlin-39339.md>)

Original publisher: [Read original article](<https://kt.academy/article/kfde-sealed>)

Published: 2023-09-04T00:01:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [sealed class](<https://devfeed.tech/topics/sealed-class.md>), [sealed interface](<https://devfeed.tech/topics/sealed-interface.md>), [interface](<https://devfeed.tech/topics/interface.md>), [abstract class](<https://devfeed.tech/topics/abstract-class.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interface](<https://devfeed.tech/tags/interface.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [sealed-classes](<https://devfeed.tech/tags/sealed-classes.md>), [sealed-interface](<https://devfeed.tech/tags/sealed-interface.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This Kotlin tutorial explains sealed classes and sealed interfaces as restricted hierarchies whose direct subclasses are controlled. It contrasts them with regular interfaces and abstract classes, describes their package and module requirements, and explains their use in exhaustive expressions.

### Source excerpt

What are sealed classes and interfaces in Kotlin and how do we use them.

## Interface Delegation

DevFeed: [Interface Delegation](<https://devfeed.tech/articles/interface-delegation-39200.md>)

Original publisher: [Read original article](<https://kt.academy/article/ak-interface-delegation>)

Published: 2023-03-06T00:15:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [interface](<https://devfeed.tech/topics/interface.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [delegates](<https://devfeed.tech/tags/delegates.md>), [delegation](<https://devfeed.tech/tags/delegation.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interface](<https://devfeed.tech/tags/interface.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [safety](<https://devfeed.tech/tags/safety.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This tutorial explains Kotlin interface delegation through the delegation pattern, composition, and comparison with inheritance. It describes how delegation reuses implementations, supports polymorphic behavior, and reduces the additional code needed when specifying a delegate.

### Source excerpt

One of the least known Kotlin features, that can be sometimes found really useful.

## What's a vtable? What's an IUnknown?

DevFeed: [What's a vtable? What's an IUnknown?](<https://devfeed.tech/articles/what-s-a-vtable-what-s-an-iunknown-39729.md>)

Original publisher: [Read original article](<https://www.timdbg.com/posts/vtables/>)

Author: Tim Misiak

Published: 2022-12-18T15:30:09Z

Content type: tutorial

Language: en

Sources: [TimDbg](<https://devfeed.tech/sources/timdbg.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Windows](<https://devfeed.tech/topics/windows.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [MSVC](<https://devfeed.tech/topics/msvc.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [class](<https://devfeed.tech/tags/class.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [debugger](<https://devfeed.tech/tags/debugger.md>), [function](<https://devfeed.tech/tags/function.md>), [msvc](<https://devfeed.tech/tags/msvc.md>), [virtual](<https://devfeed.tech/tags/virtual.md>), [windows](<https://devfeed.tech/tags/windows.md>)

### AI overview

This tutorial explains how C++ virtual function tables, or vtables, support dynamic dispatch and how they relate to COM objects on Windows. It also introduces debugger-based techniques for examining vtables and discusses errors that can be difficult to diagnose.

### Source excerpt

Understanding vtables (also called VMT/Virtual Method Tables or VFT/Virtual Function Tables) is important for understanding how many C++ features work on any OS. They are even more important to understand on Windows, where vtables are used for communication between modules using COM. There are a few types of errors that can happen when things go wrong with them, and some of these will be extremely difficult to diagnose unless you understand how vtables actually work.

## The modifier that shouldn't be there

DevFeed: [The modifier that shouldn't be there](<https://devfeed.tech/articles/the-modifier-that-shouldn-t-be-there-25894.md>)

Original publisher: [Read original article](<https://proandroiddev.com/the-modifier-that-shouldnt-be-there-77ff941f0529?source=rss-1331e67af4e1------2>)

Author: Danny Preussler

Published: 2021-05-31T14:15:00Z

Content type: article

Language: en

Sources: [Danny Preussler](<https://devfeed.tech/sources/stories-by-danny-preussler-on-medium.md>)

Topics: [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>)

Tags: [android-studio](<https://devfeed.tech/tags/android-studio.md>), [behavior](<https://devfeed.tech/tags/behavior.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [call](<https://devfeed.tech/tags/call.md>), [class](<https://devfeed.tech/tags/class.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [example](<https://devfeed.tech/tags/example.md>), [extend](<https://devfeed.tech/tags/extend.md>), [fields](<https://devfeed.tech/tags/fields.md>), [interface](<https://devfeed.tech/tags/interface.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [open](<https://devfeed.tech/tags/open.md>), [open-class](<https://devfeed.tech/tags/open-class.md>), [override](<https://devfeed.tech/tags/override.md>), [programming](<https://devfeed.tech/tags/programming.md>), [properties](<https://devfeed.tech/tags/properties.md>), [property](<https://devfeed.tech/tags/property.md>), [type](<https://devfeed.tech/tags/type.md>), [val](<https://devfeed.tech/tags/val.md>)

### AI overview

Kotlin properties are final by default, but an interface property implemented with `override val` is open unless marked `final`. The excerpt's original case came from `@OpenForTesting`, which a compiler plugin uses to open the class and its fields for mocking. Overriding such a property can cause a constructor hazard: the parent initializer calls the child getter before the child backing field is initialized, producing `null`. The author advises avoiding access to non-final fields from constructors and suggests considering Mockito's inline mock maker or using fewer mocks.

### Source excerpt

The Kotlin modifier that shouldn't be therePhoto by Belinda Fewings on Unsplash Most Kotlin developers would agree that a val property is equivalent to a final property in Java. What if I tell you that this is not completely true and sometimes you might need a final val? Opposite to Java, Kotlin properties are final by default unless they are explicitly marked as open! This would mean there is no need for the final keyword, right? Let's Google that: As the internet confirmed our hypothesis, I was quite surprised when Android Studio told me to addfinal to a val: and indeed adding final would fix that: So there is a final keyword for properties but why and when should we make a val final? Let's look at this behavior using a simple example: class FinalBlog { val someProperty: String = "some" init { print(someProperty + "thing") } } "Everything works as expected here and the code will print "something" when the class is instantiated. Let's modify everything to be open: open class FinalBlog { open val someProperty: String = "some" init { print(someProperty + "thing") } } This will trigger the same type of warning I got before. This is very obvious when you think about it. The class can be subclassed and our property might be overridden. This could lead to unexpected side effects (which we will look into at the end of this post.). We can fix this simply by removing theopen modifier from the field. So, althought the warning has the same cause, it's not the exact same scenario my Android Studio was warning me on, there is no way I could add final here: non open already means final! Let's try something else: interface BlogTopic { val someProperty: String } open class FinalBlog: BlogTopic { override val someProperty: String = "some" init { print(someProperty + "thing") } } If the property is inherited from an interface, then it's open by default! Again, we will get the warning, we were looking for: And this time adding the final modifier will fix it: open class FinalBlog: Blo

## if-else-switch

DevFeed: [if-else-switch](<https://devfeed.tech/articles/if-else-switch-21793.md>)

Original publisher: [Read original article](<http://blog.cleancoder.com/uncle-bob/2021/03/06/ifElseSwitch.html>)

Published: 2021-03-06T00:00:00Z

Content type: opinion

Language: en

Sources: [Clean Code](<https://devfeed.tech/sources/the-clean-code-blog.md>), [Robert C. Martin](<https://devfeed.tech/sources/robert-c-martin.md>)

Topics: [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [Software](<https://devfeed.tech/topics/software.md>), [systems](<https://devfeed.tech/topics/systems.md>), [cloud-infrastructure](<https://devfeed.tech/topics/cloud-infrastructure.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [monolithic-architecture](<https://devfeed.tech/tags/monolithic-architecture.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [software](<https://devfeed.tech/tags/software.md>), [source](<https://devfeed.tech/tags/source.md>), [structure](<https://devfeed.tech/tags/structure.md>)

### AI overview

The article argues that repeated if/else or switch statements create fragile systems and tangled dependencies. It recommends isolating the conditional logic in a factory and using polymorphic objects to break dependencies on lower-level modules, supporting more flexible component-based architectures.

### Source excerpt

A few days ago someone tweeted a question asking which of the following PHP snippets was better than the others, or whether there might be an even better approach. I tweeted my answer in the following cryptic paragraph. Place the if/else cases in a factory object that creates a polymorphic object for each variant. Create the factory in 'main' and pass it into your app. That will ensure that the if/else chain occurs only once. Others have since asked me for an example. Twitter is not the best medium for that so... Firstly, if the sole intent of the programmer is to translate: 0->'male', 1->'female' otherwise -> 'unknown' ...then his refactoring #2 would be my preference. However, I have a hard time believing that the business rules of the system are not using that gender code for making policy decisions. My fear is that the if/else/switch chain that the author was asking about is replicated in many more places within the code. Some of those if/else/switch statements might switch on the integer, and others might switch on the string. It's not inconceivable that you'd find a if/else/switch that used an integer in one case and a string in the next! The proliferation of if/else/switch statements is a common problem in software systems. The fact that they are replicated in many places is problematic because when such statements are inevitably changed, it is easy to miss some. This leads to fragile systems. But there is a worse problem with if/else/switch statements. It's the dependency structure. Such statements tend to have cases that point outwards towards lower level modules. This often means that the module containing the if/else/switch will have source code dependencies upon those lower level modules. That's bad enough. We don't like dependencies that run from high level modules to low level modules. They thwart our desire to create architectures that are made up of independently deployable components. However, the above diagram shows that it's worse than that. Other hig

## PHP reimagined

DevFeed: [PHP reimagined](<https://devfeed.tech/articles/php-reimagined-44232.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/php-reimagined>)

Author: Brent

Published: 2021-01-13T00:00:00Z

Content type: opinion

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [interface](<https://devfeed.tech/topics/interface.md>)

Tags: [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interface](<https://devfeed.tech/tags/interface.md>), [php](<https://devfeed.tech/tags/php.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [programming](<https://devfeed.tech/tags/programming.md>), [properties](<https://devfeed.tech/tags/properties.md>)

### AI overview

An opinion piece proposes changes to PHP, including making classes final by default, restricting inheritance, requiring return types and typed parameters, and requiring typed properties and visibility modifiers.

### Source excerpt

Read the full post on https://stitcher.io/blog/php-reimagined

## Solid Relevance

DevFeed: [Solid Relevance](<https://devfeed.tech/articles/solid-relevance-21791.md>)

Original publisher: [Read original article](<http://blog.cleancoder.com/uncle-bob/2020/10/18/Solid-Relevance.html>)

Published: 2020-10-18T00:00:00Z

Content type: opinion

Language: en

Sources: [Clean Code](<https://devfeed.tech/sources/the-clean-code-blog.md>), [Robert C. Martin](<https://devfeed.tech/sources/robert-c-martin.md>)

Topics: [software-architecture](<https://devfeed.tech/topics/software-architecture.md>), [Code](<https://devfeed.tech/topics/code.md>), [Microservices](<https://devfeed.tech/topics/microservices.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [gui](<https://devfeed.tech/tags/gui.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [microservices](<https://devfeed.tech/tags/microservices.md>), [sql](<https://devfeed.tech/tags/sql.md>)

### AI overview

The article argues that the SOLID principles remain relevant despite modern development practices such as microservices and reduced reliance on inheritance. It explains that software fundamentals have changed little and illustrates the Single Responsibility Principle by separating business rules, GUI code, SQL queries, communications protocols, and independently changing modules. The supplied text ends partway through the discussion.

### Source excerpt

Recently I received a letter from someone with a concern. It went like this: For years the knowledge of the SOLID principle has been a standard part of our recruiting procedure. Candidates were expected to have a good working knowledge of these principles. Lately, however, one of our managers, who doesn't code much anymore, has questioned whether that is wise. His points were that the Open-Closed principle isn't very important anymore because most of the code we write isn't contained in large monoliths and making changes to small microservices is safe and easy. The Liskov Substitution Principle is long out of date because we don't focus on inheritance nearly as much as we did 20 years ago. I think we should consider Dan North's position on SOLID - "Just write simple code." I wrote the following letter in response: The SOLID principles remain as relevant to day as they were in the 90s (and indeed before that). This is because software hasn't changed all that much in all those years -- and that is because software hasn't change all that much since 1945 when Turing wrote the first lines of code for an electronic computer. Software is still if statements, while loops, and assignment statements -- Sequence, Selection, and Iteration. Every new generation likes to think that their world is vastly different from the generation before. Every new generation is wrong about that; which is something that every new generation learns once the next new generation comes along to tell them how much everything has changed. <grin> So let's walk through the principles, one by one. SRP) The Single Responsibility Principle. Gather together the things that change for the same reasons. Separate things that change for different reasons. It is hard to imagine that this principle is not relevant in software. We do not mix business rules with GUI code. We do not mix SQL queries with communications protocols. We keep code that is changed for different reasons separate so that changes to one part t

## Android and Java Technical Interview Questions for Large Technology Companies

DevFeed: [Android and Java Technical Interview Questions for Large Technology Companies](<https://devfeed.tech/articles/crack-top-android-development-company-interview-23098.md>)

Original publisher: [Read original article](<https://medium.com/android-news/crack-top-android-development-company-interview-f106756f045e?source=rss----8fca399d4de---4>)

Author: Budhdi Sharma

Published: 2020-05-08T20:48:42Z

Content type: tutorial

Language: en

Sources: [Android & Tech News](<https://devfeed.tech/sources/android-tech-news-medium.md>)

Topics: [software-development](<https://devfeed.tech/topics/software-development.md>), [Android](<https://devfeed.tech/topics/android.md>), [Java](<https://devfeed.tech/topics/java.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [computational complexity](<https://devfeed.tech/topics/computational-complexity.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [crack](<https://devfeed.tech/tags/crack.md>), [development](<https://devfeed.tech/tags/development.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [interview](<https://devfeed.tech/tags/interview.md>), [java](<https://devfeed.tech/tags/java.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [tips](<https://devfeed.tech/tags/tips.md>)

### AI overview

This interview-preparation article outlines knowledge areas for Android development interviews, including Java fundamentals, Android questions, advanced development technologies, and cross-platform hybrid development. It highlights topics such as Java APIs, source-code implementation principles, algorithms, design patterns, equality and hash codes, primitive sizes, and polymorphism.

### Source excerpt

The interviewer in interviews asked these questions with top-tier Internet companies. Familiarity with the knowledge points listed in this... Continue reading on AndroidPub "

## Enums without enums in PHP

DevFeed: [Enums without enums in PHP](<https://devfeed.tech/articles/enums-without-enums-in-php-44120.md>)

Original publisher: [Read original article](<https://stitcher.io/blog/enums-without-enums>)

Author: Brent

Published: 2020-02-01T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stitcher](<https://devfeed.tech/sources/stitcher-io.md>)

Topics: [enum](<https://devfeed.tech/topics/enum.md>), [PHP](<https://devfeed.tech/topics/php.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [class](<https://devfeed.tech/topics/class.md>), [conditionals](<https://devfeed.tech/topics/conditionals.md>), [properties](<https://devfeed.tech/topics/properties.md>)

Tags: [classes](<https://devfeed.tech/tags/classes.md>), [conditionals](<https://devfeed.tech/tags/conditionals.md>), [enums](<https://devfeed.tech/tags/enums.md>), [php](<https://devfeed.tech/tags/php.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [properties](<https://devfeed.tech/tags/properties.md>)

### AI overview

This PHP tutorial explains how to model enum-like values without native enums by using strongly typed classes, polymorphism, and value-specific behavior. It also shows how this approach avoids large conditional blocks and can be refined with anonymous classes and properties.

### Source excerpt

Read the full post on https://stitcher.io/blog/enums-without-enums

[Next page](<https://devfeed.tech/topics/polymorphism.md?cursor=WyIyMDIwLTAyLTAxVDAwOjAwOjAwKzAwOjAwIiwgIjA1ZDgyMmViLTE4YWYtNGIxNy1hZjRjLWM3ODE2M2Y3OTE5MCJd>)