comp.lang.ada
 help / color / mirror / Atom feed
From: "A. Cervetti" <andrea.cervetti@gmail.com>
Subject: Suggestions needed to split a package
Date: Fri, 24 May 2019 08:49:42 -0700 (PDT)
Date: 2019-05-24T08:49:42-07:00	[thread overview]
Message-ID: <9fd1cb3d-6e81-47bb-afd2-cae1cd3658a1@googlegroups.com> (raw)

A package in the program I am writing is getting too long.
So I thought it would be a good idea to split it.

The package is here: https://github.com/andreacervetti/ada-virt-monitor/tree/master/avm/src/monitor (files monitor-structures.ad*).

My problems are:
I'd like to avoid forcing clients of the package to "with" too many modules.
I want keep private types private.
Subroutines in the current package see all the private types and operate directly on record fields and build objects using extension aggregates.
One of the record types contain a vector of the other.

Being private types simply splitting the file and using "limited with" clause  would not be possible, because there would be no visibility of the private part.
I thought to define the types as abstract in the parent package and then derive non-abstract types in children.
Would it be feasible?
I don't know how big would be the impact on current code. 
To further complicate things there is a child module that operates on structure built in the package.

Before embarking on a huge job of modifying the current code I need some suggestions.
Does it make sense what I am planning or would it be better leave thing as they are?

Thanks in advance

A. Cervetti


             reply	other threads:[~2019-05-24 15:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24 15:49 A. Cervetti [this message]
2019-05-24 16:14 ` Suggestions needed to split a package Björn Lundin
2019-05-24 20:26   ` Randy Brukardt
2019-05-24 21:21     ` Shark8
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox