Data: fields vs properties Boilerplate Getters and Setters Cutting the boilerplate, and the impact Beyond the boilerplate for getters and setters Data: fields vs properties Classes have both functions called methods and instance data or fields. Python also uses the term properties, for data that has an explicit getters function and optionally setter a setter… Continue reading Class data: Getters, Setters & Properties
Category: 2-Code
Defining, Construct & Init for Classes
defining classes: constructors and init python vs kotlin Syntax Hopefully the above python code is self explanatory. Example 2 adds a base class. I do not deal with multiple inheritance at this time, and will devote a specific page at some future time as for python it gets complex, and for kotlin it requires additional… Continue reading Defining, Construct & Init for Classes
Python dataclasses: A revolution
Python data classes are a new feature in Python 3.7, which is currently in Beta 4 and scheduled for final release in June 2018. However, a simple pip install brings a backport to Python 3.6. The name dataclass sounds like this feature is specifically for classes with data and no methods, but in reality, just… Continue reading Python dataclasses: A revolution
What is a DSL?
With Kotlin the term ‘Kotlin DSL’ usually refers to DSLs built in Kotlin using specific Kotlin features (as discussed in 'Kotlin DSLs'), this page, however, is about DSLs in general. Introduction: DSL: The general definition DSL vs 'a DSL' The Types of DSL: External DSL Internal Detached DSL Internal Augmentation DSL Detached vs Internal DSL:… Continue reading What is a DSL?
Class Level Objects, Companion Objects & Instances
Topics for this section: Class Level Objects & Companion Objects: Key Terminology. the simplest case - one object type Python - an additional object type requires precise terminology Kotlin: the companion object equates to the Python class object Class & Companion Variables and Methods vs instance methods and variables Terminology for Clarity: Class Level Object,… Continue reading Class Level Objects, Companion Objects & Instances