# subclass

Published articles for subclass.

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

## Abstract and Open Classes

DevFeed: [Abstract and Open Classes](<https://devfeed.tech/articles/abstract-and-open-classes-25047.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-abstract-and-open-classes/>)

Author: author@typealias.com (Dave Leeds)

Published: 2023-08-21T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>)

Tags: [abstract-class](<https://devfeed.tech/tags/abstract-class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [compare](<https://devfeed.tech/tags/compare.md>), [delegation](<https://devfeed.tech/tags/delegation.md>), [extend](<https://devfeed.tech/tags/extend.md>), [function](<https://devfeed.tech/tags/function.md>), [implement](<https://devfeed.tech/tags/implement.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interface](<https://devfeed.tech/tags/interface.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [open-class](<https://devfeed.tech/tags/open-class.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [programming](<https://devfeed.tech/tags/programming.md>), [retro](<https://devfeed.tech/tags/retro.md>), [speed](<https://devfeed.tech/tags/speed.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [superclass](<https://devfeed.tech/tags/superclass.md>)

### AI overview

A tutorial chapter explaining how to extend open and abstract classes to create subtypes and share general code. It compares this approach with interfaces and delegation, highlighting that each has advantages and disadvantages.

### Source excerpt

In Chapter 12, we saw how we could use interfaces to create subtypes, and in the last chapter, we saw how we could use delegation with interfaces in order to share general code among specific classes. In this chapter, we'll learn how we can extend open and abstract classes to accomplish these same things with a different approach. Each approach has its advantages and disadvantages, so we'll also look at how they compare to one another.

## Avoid Java double brace initialization

DevFeed: [Avoid Java double brace initialization](<https://devfeed.tech/articles/avoid-java-double-brace-initialization-25619.md>)

Original publisher: [Read original article](<https://blog.p-y.wtf/avoid-java-double-brace-initialization>)

Author: Pierre-Yves Ricau

Published: 2023-06-27T20:58:00Z

Content type: tutorial

Language: en

Sources: [Py's blog](<https://devfeed.tech/sources/py-s-blog.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Code](<https://devfeed.tech/topics/code.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [crash-reporting](<https://devfeed.tech/tags/crash-reporting.md>), [gc](<https://devfeed.tech/tags/gc.md>), [global](<https://devfeed.tech/tags/global.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [java](<https://devfeed.tech/tags/java.md>), [leak](<https://devfeed.tech/tags/leak.md>), [leakcanary](<https://devfeed.tech/tags/leakcanary.md>), [lifecycle](<https://devfeed.tech/tags/lifecycle.md>), [memory](<https://devfeed.tech/tags/memory.md>), [memory-leak](<https://devfeed.tech/tags/memory-leak.md>), [object](<https://devfeed.tech/tags/object.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [subclass](<https://devfeed.tech/tags/subclass.md>)

### AI overview

This tutorial explains how Java double brace initialization can cause memory leaks. An anonymous HashMap subclass implicitly retains its outer Activity, so a breadcrumb stored by a singleton BugSnag client can keep a destroyed Android Activity in memory. The article recommends avoiding the pattern and using explicit initialization or Kotlin.

### Source excerpt

TL;DR Avoid doing this: new HashMap() {{ put("key", value); }}; Leak Trace I was recently looking at the following leak trace from LeakCanary: ┬─── │ GC Root: Global variable in native code │ ├─ com.bugsnag.android.AnrPlugin instan...

## Effective Class Delegation

DevFeed: [Effective Class Delegation](<https://devfeed.tech/articles/effective-class-delegation-27061.md>)

Original publisher: [Read original article](<https://zsmb.co/effective-class-delegation/>)

Author: Márton Braun

Published: 2020-09-29T20:00:00Z

Content type: tutorial

Language: en

Sources: [zsmb.co](<https://devfeed.tech/sources/zsmb-co.md>)

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

Tags: [android](<https://devfeed.tech/tags/android.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [delegation](<https://devfeed.tech/tags/delegation.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interface](<https://devfeed.tech/tags/interface.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [marton-braun](<https://devfeed.tech/tags/marton-braun.md>), [override](<https://devfeed.tech/tags/override.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [superclass](<https://devfeed.tech/tags/superclass.md>), [zsmb](<https://devfeed.tech/tags/zsmb.md>), [zsmb-co](<https://devfeed.tech/tags/zsmb-co.md>), [zsmb13](<https://devfeed.tech/tags/zsmb13.md>), [zsmbco](<https://devfeed.tech/tags/zsmbco.md>)

### AI overview

This tutorial explains how Kotlin class delegation can implement an interface by forwarding calls to a contained object. It contrasts this concise approach with Java solutions motivated by Effective Java's recommendation to favor composition over inheritance.

### Source excerpt

One of the most significant items of the Effective Java book is Item 18: Favor composition over inheritance. Let's see how Kotlin promotes this with class delegation.

## TIP: Adapting to Tablets

DevFeed: [TIP: Adapting to Tablets](<https://devfeed.tech/articles/tip-adapting-to-tablets-19561.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/tip-adapting-to-tablets/>)

Author: Shai Almog

Published: 2019-03-04T00:00:00Z

Content type: tutorial

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [App](<https://devfeed.tech/topics/app.md>), [Development](<https://devfeed.tech/topics/development.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [app-development](<https://devfeed.tech/tags/app-development.md>), [classes](<https://devfeed.tech/tags/classes.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [development](<https://devfeed.tech/tags/development.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [phone-app](<https://devfeed.tech/tags/phone-app.md>), [phones](<https://devfeed.tech/tags/phones.md>), [subclass](<https://devfeed.tech/tags/subclass.md>)

### AI overview

This tutorial presents a "phone first" approach for adapting Codename One applications to tablets. It describes building the phone version first, then restructuring forms and subclasses to support a tablet layout with a permanent side menu and replaceable content. The author notes that generalizing the approach into a standardized API has been difficult.

### Source excerpt

A while back someone asked on stackoverflow how to adapt a Codename One app to tablets. I provided quite a few references in the answer and following discussion but I think a better approach is to explain what we did with the recent Codename One Build app because that's what I've been doing in all recent apps I worked on. I call this approach the "phone first" approach for universal app development. It starts by forgetting about the tablet and focusing on building a good looking phone app. In this app I usually subclass Form for all the classes which instantly creates an app that's very suitable for phones.

## Build an AngrDBG frontend for your debugger

DevFeed: [Build an AngrDBG frontend for your debugger](<https://devfeed.tech/articles/build-an-angrdbg-frontend-for-your-debugger-41512.md>)

Original publisher: [Read original article](<https://andreafioraldi.github.io/articles/2018/09/22/angrdbg-frontend.html>)

Author: malweisse's corruptions

Published: 2018-09-22T00:00:00Z

Content type: tutorial

Language: en

Sources: [The blog of malweisse's corruptions](<https://devfeed.tech/sources/the-blog-of-malweisse-s-corruptions.md>)

Topics: [synchronization](<https://devfeed.tech/topics/synchronization.md>), [gdb](<https://devfeed.tech/topics/gdb.md>), [debug](<https://devfeed.tech/topics/debug.md>), [Processes](<https://devfeed.tech/topics/processes.md>)

Tags: [debugger](<https://devfeed.tech/tags/debugger.md>), [gdb](<https://devfeed.tech/tags/gdb.md>), [process](<https://devfeed.tech/tags/process.md>), [python](<https://devfeed.tech/tags/python.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>)

### AI overview

This tutorial explains how to build a frontend for a debugger using AngrDBG. It describes the subclass and registration required to synchronize a concrete process state with an angr state, along with methods for process control, memory and register access, executable metadata, and symbol resolution.

### Source excerpt

AngrDBG is the library that I developed to synchronize a concrete process state with an angr state. The library is debugger agnostic. A frontend library that integrates AngrDBG with a specific debugger must implements a subclass of angrdbg.Debugger and register an istance of that class as source of data using angrdbg.register_debugger. The methods that must be implemented are the following: before_stateshot(self) An event handler triggered before the synchronization setup in StateShot, just after the empty state creation after_stateshot(self, state) An event handler triggered before the StateShot return is_active(self) Return True if the debugger is running the target process input_file(self) Return a python file-like object of the target executable image_base(self) Return the process base address get_<byte|word|dword|qword>(self, addr) Read an byte|word|dword|qword from the memory as a python int (4 distinct methods) get_bytes(self, addr, size) Read a string from the memory put_<byte|word|dword|qword>(self, addr, value) Write a python in as a byte|word|dword|qword to the memory (4 distinct methods) put_bytes(self, addr, value) Write a string to the memory get_reg(self, name) Get a register value set_reg(self, name, value) Set a register value step_into(self) Call the debugger step into command run(self) Run the process inside the debugger wait_ready(self) Wait until the debugged process is ready to be inspected refresh_memory(self) Refresh the memory API of the debugger seg_by_name(self, name) Get a Segment object by the name seg_by_addr(self, name) Get a Segment object by the address get_got(self) Get a tuple (start address, end address) related to the GOT section get_plt(self) Get a tuple (start address, end address) related to the PLT section resolve_name(self, name) Resolve a symbol to its address using the name You can find here the GDBDebugger class used in the GDB frontend.

## A Canonical equals() For Java

DevFeed: [A Canonical equals() For Java](<https://devfeed.tech/articles/a-canonical-equals-for-java-32219.md>)

Original publisher: [Read original article](<https://bruceeckel.com/2017/01/07/a-canonical-equals-for-java/>)

Author: Bruce Eckel

Published: 2017-01-07T00:00:00Z

Content type: tutorial

Language: en

Sources: [Bruce Eckel - Computing Thoughts](<https://devfeed.tech/sources/bruce-eckel-computing-thoughts.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [code](<https://devfeed.tech/tags/code.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [equals](<https://devfeed.tech/tags/equals.md>), [fields](<https://devfeed.tech/tags/fields.md>), [interface](<https://devfeed.tech/tags/interface.md>), [java](<https://devfeed.tech/tags/java.md>), [object](<https://devfeed.tech/tags/object.md>), [override](<https://devfeed.tech/tags/override.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [subtype](<https://devfeed.tech/tags/subtype.md>), [tests](<https://devfeed.tech/tags/tests.md>)

### AI overview

This Java tutorial explains how to implement a concise equals() method using Java 7's Objects.equals(). It covers the equals contract, identity and type checks, selected-field comparisons, and tests using example classes and a factory method.

### Source excerpt

Even with the help of Java 7's Objects.equals(), the equals() method is often written in a verbose and messy fashion. This article shows how you can write a succinct equals() in a format that allows easy checking with visual inspection. When you create a new class, it automatically inherits class Object. If you don't override equals(), you'll get Objects equals() method. By default this compares addresses, so only if you are comparing the exact same objects will you get true.

## Custom Errors in TypeScript 2.1

DevFeed: [Custom Errors in TypeScript 2.1](<https://devfeed.tech/articles/custom-errors-in-typescript-2-1-31839.md>)

Original publisher: [Read original article](<https://www.metachris.dev/2017/01/custom-errors-in-typescript-2.1/>)

Author: Chris Hager

Published: 2017-01-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [Chris Hager](<https://devfeed.tech/sources/chris-hager.md>)

Topics: [TypeScript](<https://devfeed.tech/topics/typescript.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [custom](<https://devfeed.tech/tags/custom.md>), [errors](<https://devfeed.tech/tags/errors.md>), [native](<https://devfeed.tech/tags/native.md>), [prototype](<https://devfeed.tech/tags/prototype.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

### AI overview

A tutorial on handling custom Error subclasses in TypeScript 2.1, where extending built-in types such as Error may leave subclass methods undefined and cause instanceof checks to fail. It presents a solution that reliably works, including with native and Bluebird promises.

### Source excerpt

TypeScript 2.1 introduced a number of breaking changes, among them that "Extending built-ins like Error, Array, and Map may no longer work". For a subclass like the following: class FooError extends Error { constructor(m: string) { super(m); } sayHello() { return "hello " + this.message; } } methods may be undefined on objects returned by constructing these subclasses, so calling sayHello will result in an error. instanceof will be broken between instances of the subclass and their instances, so (new FooError()) instanceof FooError will return false.

## A Modern Network Operation

DevFeed: [A Modern Network Operation](<https://devfeed.tech/articles/a-modern-network-operation-37510.md>)

Original publisher: [Read original article](<https://www.cimgf.com/2016/01/28/a-modern-network-operation/>)

Author: Marcus Zarra

Published: 2016-01-28T20:12:28Z

Content type: article

Language: en

Sources: [Cocoa Is My Girlfriend](<https://devfeed.tech/sources/cocoa-is-my-girlfriend.md>)

Topics: [Network](<https://devfeed.tech/topics/network.md>), [API](<https://devfeed.tech/topics/api.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [Objective-C](<https://devfeed.tech/topics/objective-c.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [apple](<https://devfeed.tech/tags/apple.md>), [developers](<https://devfeed.tech/tags/developers.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [network](<https://devfeed.tech/tags/network.md>), [nsoperation](<https://devfeed.tech/tags/nsoperation.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [structure](<https://devfeed.tech/tags/structure.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

This article discusses designing network operations around Apple's NSURLSession API. It argues that block-based network calls can encourage poor structure and describes a design using subclasses, lifecycle control, implementation changes, and supporting properties for network data and tasks, with Swift-specific differences from Objective-C.

### Source excerpt

When Apple introduced the NSURLSession API, the landscape of network operations changed. In some ways, the new API made things worse as the block API that was added tempts developers to become very sloppy with network calls. The block API makes it trivial to add network calls anywhere in an application. Very little thought or [...]

## Custom Drawables

DevFeed: [Custom Drawables](<https://devfeed.tech/articles/custom-drawables-30577.md>)

Original publisher: [Read original article](<https://ryanharter.com/blog/2015/04/custom-drawables/>)

Published: 2015-04-03T07:00:00Z

Content type: tutorial

Language: en

Sources: [Blogs on Ryan Harter](<https://devfeed.tech/sources/blogs-on-ryan-harter.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Code](<https://devfeed.tech/topics/code.md>), [Canvas](<https://devfeed.tech/topics/canvas.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [canvas](<https://devfeed.tech/tags/canvas.md>), [code](<https://devfeed.tech/tags/code.md>), [source](<https://devfeed.tech/tags/source.md>), [subclass](<https://devfeed.tech/tags/subclass.md>)

### AI overview

This tutorial explains how to use custom Android Drawables to encapsulate application logic and create a reveal transition between selected and unselected icons in a horizontally scrolling selection view. It describes subclassing Drawable, using setLevel(int) to represent selection progress, and clipping the canvas during drawing.

### Source excerpt

We've all seen posts about why you should use custom views when applicable and how it can help you properly encapsulate your application code. What we don't see quite as much is how this type of thinking can be translated to other, non-View related, portions of our apps. In my app, Fragment, there are a few places where I make use of custom Drawables to encapsulate my logic just like you would for a custom View.

## Getting the current filename with Spark and HDFS

DevFeed: [Getting the current filename with Spark and HDFS](<https://devfeed.tech/articles/getting-the-current-filename-with-spark-and-hdfs-20849.md>)

Original publisher: [Read original article](<http://themodernlife.net/scala/spark/hadoop/hdfs/2014/09/28/spark-input-filename/>)

Published: 2014-09-28T11:50:13Z

Content type: tutorial

Language: en

Sources: [Ian Hummel](<https://devfeed.tech/sources/ian-hummel.md>)

Topics: [Apache Spark](<https://devfeed.tech/topics/spark.md>), [Hadoop](<https://devfeed.tech/topics/hadoop.md>)

Tags: [apache-spark](<https://devfeed.tech/tags/apache-spark.md>), [foreach](<https://devfeed.tech/tags/foreach.md>), [hadoop](<https://devfeed.tech/tags/hadoop.md>), [hdfs](<https://devfeed.tech/tags/hdfs.md>), [map](<https://devfeed.tech/tags/map.md>), [reduce](<https://devfeed.tech/tags/reduce.md>), [scala](<https://devfeed.tech/tags/scala.md>), [spark](<https://devfeed.tech/tags/spark.md>), [subclass](<https://devfeed.tech/tags/subclass.md>)

### AI overview

A tutorial shows how to obtain the filename being processed in a Spark map/reduce job. It uses Spark 1.1.0's HadoopRDD.mapPartitionsWithInputSplit with FileSplit, and notes that the approach requires an InputFormat subclass of FileInputFormat.

### Source excerpt

It's occasionally useful when writing map/reduce jobs to get a hold of the current filename that's being processed. There's a few ways to do this, depending on the version of Spark that you're using. Spark 1.1.0 introduced a new method on HadoopRDD that makes this super easy: import org.apache.hadoop.io.LongWritable import org.apache.hadoop.io.Text import org.apache.hadoop.mapred.{FileSplit, TextInputFormat} import org.apache.spark.rdd.HadoopRDD // Create the text file val text = sc.hadoopFile("file:///tmp/files", classOf[TextInputFormat], classOf[LongWritable], classOf[Text], sc.defaultMinPartitions) // text: org.apache.spark.rdd.RDD[(org.apache.hadoop.io.LongWritable, org.apache.hadoop.io.Text)] = file:///tmp/files HadoopRDD[2] at hadoopFile at <console>:16 // Cast to a HadoopRDD val hadoopRdd = text.asInstanceOf[HadoopRDD[LongWritable, Text]] // hadoopRdd: org.apache.spark.rdd.HadoopRDD[org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text] = file:///tmp/files HadoopRDD[2] at hadoopFile at <console>:16 val fileAndLine = hadoopRdd.mapPartitionsWithInputSplit { (inputSplit, iterator) ⇒ val file = inputSplit.asInstanceOf[FileSplit] iterator.map { tpl ⇒ (file.getPath, tpl._2) } } fileAndLine.foreach(println) // prints lines like (file:/tmp/files/part-00000,line1...), (file:/tmp/files/part-00000,line2...), ... There are a few things to note: - You can't simply use sc.textFile because under the hood, the textFile method actually maps the resulting HadoopRDD, returning a MappedRDD which is not what we want - This will only work if your InputFormat is a subclass of FileInputFormat - mapPartitionsWithInputSplit returns a new iterator, in this case we simply map over it (which is done lazily!) to include the split's filename

## Building Dynamic Custom Views

DevFeed: [Building Dynamic Custom Views](<https://devfeed.tech/articles/building-dynamic-custom-views-30572.md>)

Original publisher: [Read original article](<https://ryanharter.com/blog/2014/08/building-dynamic-custom-views/>)

Published: 2014-08-29T07:00:00Z

Content type: tutorial

Language: en

Sources: [Blogs on Ryan Harter](<https://devfeed.tech/sources/blogs-on-ryan-harter.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [screen](<https://devfeed.tech/topics/screen.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [padding](<https://devfeed.tech/tags/padding.md>), [screen](<https://devfeed.tech/tags/screen.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [view](<https://devfeed.tech/tags/view.md>)

### AI overview

A tutorial on building a custom Android view that lets users scroll content so any item can align with the center of the screen. It discusses using a HorizontalScrollView, adding scroll-position observation through subclassing, and handling side padding for different screen sizes.

### Source excerpt

Last week I released Fragment for Android. Fragment is made up of all sorts of custom Views, which I think sets it apart from many apps in the Play Store. Some of these views have a similar pattern to views I've had to create for other apps, in which a scroll view has padding such that every item within it can be scrolled to the center of the view. On it's surface this doesn't seem complex, but when you consider the massive difference in screen sizes available on Android, things get a little more complicated.

## Liskov Substitution Principle

DevFeed: [Liskov Substitution Principle](<https://devfeed.tech/articles/liskov-substitution-principle-40710.md>)

Original publisher: [Read original article](<https://radek.io/posts/liskov-substitution-principle/>)

Published: 2011-08-09T00:00:00Z

Content type: tutorial

Language: en

Sources: [Radek Pazdera](<https://devfeed.tech/sources/radek-pazdera.md>)

Topics: [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>), [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [coding](<https://devfeed.tech/topics/coding.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [subtype](<https://devfeed.tech/topics/subtype.md>)

Tags: [hierarchy](<https://devfeed.tech/tags/hierarchy.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [software-design](<https://devfeed.tech/tags/software-design.md>), [solid](<https://devfeed.tech/tags/solid.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [subtype](<https://devfeed.tech/tags/subtype.md>)

### AI overview

This article explains the Liskov Substitution Principle, the L in SOLID object-oriented design. It presents definitions from Barbara Liskov and Jeannette Wing, a formulation by Robert C. Martin, and a Square-Rectangle hierarchy example showing how subtype behavior can violate substitutability.

### Source excerpt

SOLID Object-Oriented Design

## Private, protected and public in Python

DevFeed: [Private, protected and public in Python](<https://devfeed.tech/articles/private-protected-and-public-in-python-40732.md>)

Original publisher: [Read original article](<https://radek.io/posts/private-protected-and-public-in-python/>)

Published: 2011-07-21T00:00:00Z

Content type: tutorial

Language: en

Sources: [Radek Pazdera](<https://devfeed.tech/sources/radek-pazdera.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [class](<https://devfeed.tech/topics/class.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [object](<https://devfeed.tech/topics/object.md>), [pull-requests](<https://devfeed.tech/topics/pull-requests.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [object](<https://devfeed.tech/tags/object.md>), [programming](<https://devfeed.tech/tags/programming.md>), [pull-request](<https://devfeed.tech/tags/pull-request.md>), [python](<https://devfeed.tech/tags/python.md>), [subclass](<https://devfeed.tech/tags/subclass.md>)

### AI overview

This tutorial explains how Python handles public, protected, and private members through defaults, naming conventions, and name mangling rather than strict access modifiers. It also discusses how these conventions apply to subclasses and code reviews.

### Source excerpt

How does encapsulation (not) work in Python.

## The Java IAQ

DevFeed: [The Java IAQ](<https://devfeed.tech/articles/the-java-iaq-40570.md>)

Original publisher: [Read original article](<http://norvig.com/java-iaq.html>)

Published: 2005-08-08T00:00:00Z

Content type: tutorial

Language: en

Sources: [Peter Norvig](<https://devfeed.tech/sources/peter-norvig.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [boolean](<https://devfeed.tech/tags/boolean.md>), [class](<https://devfeed.tech/tags/class.md>), [equals](<https://devfeed.tech/tags/equals.md>), [java](<https://devfeed.tech/tags/java.md>), [object](<https://devfeed.tech/tags/object.md>), [subclass](<https://devfeed.tech/tags/subclass.md>)

### AI overview

A collection of infrequently answered Java questions covering finally-block execution, runtime class identity, and common errors in implementing equals for use with Hashtable.

### Source excerpt

Infrequently Answered Questions for Java