UML

A collection of 1 posts

A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
Mar 17, 2019 Kotlin software design UML

Options for managing derived attributes in Kotlin

A derived attribute is an attribute computed from other attributes e.g.: The fullName is aggregated from the first, middle and last nameThe age is computed from the birthdateetc. Kotlin offers different options to manage such derived attributes. Let’s browse through them. Inline field initialization The simplest way to manage derived attributes is to declare a property, and compound its declaration with its initialization: class Person(val firstName: String, val middle

Nicolas Fränkel
A Java geek © 2008-2025
v. f32325969478592b3c56e2566b1da38f32e70c50/10035795030
Latest Posts