Advice for building nested objects

Julia_coder
Thu, 13 Jun 2019 20:13:18 +0000
General Usage

Hello, I am looking for some advice on how to set up nested objects in Julia.

For example, if I wanted to create “schoolchildren” (with variables “age”, “testGrade”,“favouriteSubject”) which are then grouped into “classrooms” (with variables “numberOfStudents”,“averageTestGrade”,“mostPopularSubject”), which are then nested into a single “school”, what sort of data structures should I use for each level, and how would I implement them?

As may be obvious I would want the “classrooms” to be able to accumulate meta-data about the “schoolchildren” in them.

Structs seem an easy match for the schoolchildren but I’m not sure if they’ll apply to the higher-level objects.

Thanks in advance.

3 posts - 2 participants