Real World Object (RWO) & Real World Property (RWP) - RandomCatGit/Universe-Object-Library GitHub Wiki

What is an RWO?

A Real World Object, RWO for short, is the Class written in Java that extends the class UniverseObjectLibrary and represents a real world entity as a Java class. The real world object can be anything in the universe with the object's name as the name of the class and package as the classification for the RWO. For objects having same name but different meanings contextually, the package will act as a key variant between the two. Some innate characteristics of a RWO such as emergence, collective representation, substitutive existence, inheritance and implementation will be demonstrated by using the corresponding classes in the original RWO. For example, for the class Atom, Electron, Proton and Neutrons are its constituents. To represent the number of electrons or nature of the election such as spin, energy, an instance of the class Electron would be required. It is recommended to have a bottom up approach for creating RWOs to avoid later discoveries of required dependent classes for current RWO as much as possible.

Each RWO is unique, public access, instantiable, extendable, serializable, free and open source. Anyone can clone the repository or use a single RWO object as required. One of the design rule of RWOs is to have many functionality but with fewer code. This is enforced by Lombok for boilerplate getters and setters.

By default, all properties and procedures are kept private and non-static. All properties are accessed through getters and setters only. This ensures data is kept secure and thread safe. A no args parameter constructor must be provided for each RWO either through Lombok @NoArgsConstructor or defining implicitly and initializing contents of the class in the constructor.

Finally, RWOs is well documented, properly indented and easy to understand and use. For set of rules to be followed to create an RWO, see the rules page.

Common properties in RWP!

In some cases, RWOs will have common properties. These common properties can be expressed as abstract class which is denoted by RWP instead of RWO in its class info block. The main aim of RWP is to reduce redundant code, as it is with one of the properties of the project. You can see an example of RWP in SubatomicParticle.java.