Skip to content

Refactor field visibility in classes #21

@ArjinFerman

Description

@ArjinFerman

Some classes rely on several fields to determine a single property. For example the Satellite class needs several orbital parameters to determine the object's current position. These parameters, as well as the resulting position vector, are currently publicly accessibly fields, which can lead to confusion when modifying them (it could either have no effect, when orbital parameters override the position, or unintended effects, if someone forgets to set one of the orbital parameters when they want to change the object's position.

Such fields should be made private / protected, and exposed only through getters / setters.

Simple variables (object name, mass, radius) can remain accessible as public fields.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions