comp.lang.ada
 help / color / mirror / Atom feed
* Should be in the root package or its child?
@ 2014-07-23 18:58 Victor Porton
  2014-07-23 19:02 ` Victor Porton
  2014-07-24  9:06 ` AdaMagica
  0 siblings, 2 replies; 6+ messages in thread
From: Victor Porton @ 2014-07-23 18:58 UTC (permalink / raw)


I am writing thick (object oriented) bindings for Raptor RDF Syntax Library 
(libraptor2).

Should I put World_Type (used by almost every program which uses my library) 
into the root package of my library or into some its child package?

I think that it depends on the "size" (number of primitive routines, roughly 
saying) associated with World_Type. If it is small, I should keep it in the 
root package, and if it is big to "allocate" a new subunit.

Other criteria or other opinions?

-- 
Victor Porton - http://portonvictor.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Should be in the root package or its child?
  2014-07-23 18:58 Should be in the root package or its child? Victor Porton
@ 2014-07-23 19:02 ` Victor Porton
  2014-07-24  9:06 ` AdaMagica
  1 sibling, 0 replies; 6+ messages in thread
From: Victor Porton @ 2014-07-23 19:02 UTC (permalink / raw)


Victor Porton wrote:

> I am writing thick (object oriented) bindings for Raptor RDF Syntax
> Library (libraptor2).
> 
> Should I put World_Type (used by almost every program which uses my
> library) into the root package of my library or into some its child
> package?
> 
> I think that it depends on the "size" (number of primitive routines,
> roughly saying) associated with World_Type. If it is small, I should keep
> it in the root package, and if it is big to "allocate" a new subunit.
> 
> Other criteria or other opinions?

Some more entities are associated with World_Type:

Flag_Type (an enumeration)
Flag_And_Value (a record)
type Flags_Array is array(Integer range <>) of Flag_And_Value;

-- 
Victor Porton - http://portonvictor.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Should be in the root package or its child?
  2014-07-23 18:58 Should be in the root package or its child? Victor Porton
  2014-07-23 19:02 ` Victor Porton
@ 2014-07-24  9:06 ` AdaMagica
  2014-07-24 16:21   ` Victor Porton
  1 sibling, 1 reply; 6+ messages in thread
From: AdaMagica @ 2014-07-24  9:06 UTC (permalink / raw)


On Wednesday, July 23, 2014 8:58:24 PM UTC+2, Victor Porton wrote:
> Should I put World_Type (used by almost every program which uses my library) 
> into the root package of my library or into some its child package?

I think this answers your question. If it is so basic, it belongs into the root, irrespecitve of what you call the "size".

> I think that it depends on the "size" (number of primitive routines, roughly 
> saying) associated with World_Type. If it is small, I should keep it in the 
> root package, and if it is big to "allocate" a new subunit.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Should be in the root package or its child?
  2014-07-24  9:06 ` AdaMagica
@ 2014-07-24 16:21   ` Victor Porton
  2014-07-25  8:52     ` AdaMagica
  0 siblings, 1 reply; 6+ messages in thread
From: Victor Porton @ 2014-07-24 16:21 UTC (permalink / raw)


AdaMagica wrote:

> On Wednesday, July 23, 2014 8:58:24 PM UTC+2, Victor Porton wrote:
>> Should I put World_Type (used by almost every program which uses my
>> library) into the root package of my library or into some its child
>> package?
> 
> I think this answers your question. If it is so basic, it belongs into the
> root, irrespecitve of what you call the "size".
> 
>> I think that it depends on the "size" (number of primitive routines,
>> roughly saying) associated with World_Type. If it is small, I should keep
>> it in the root package, and if it is big to "allocate" a new subunit.

But can you elaborate why?

I am writing Ada bindings for the Raptor C library.

The package RDF.Raptor is currently empty:

package RDF.Raptor is

end RDF.Raptor;

So a user is probably not meant to "with" this package, only its childs.

If I place World_Type into a child package RDF.Raptor.World, it requires 
user to type just one more level in "with" and "use". It is not a heavy 
burden.

But on the other hand, things become more finely classified if I use child 
packages.

So, do you insist, that it should not be in a child library package?

-- 
Victor Porton - http://portonvictor.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Should be in the root package or its child?
  2014-07-24 16:21   ` Victor Porton
@ 2014-07-25  8:52     ` AdaMagica
  2014-07-25 12:20       ` Victor Porton
  0 siblings, 1 reply; 6+ messages in thread
From: AdaMagica @ 2014-07-25  8:52 UTC (permalink / raw)


On Thursday, July 24, 2014 6:21:40 PM UTC+2, Victor Porton wrote:

> package RDF.Raptor is
>
> end RDF.Raptor;

What do you gain with an empty package?

> But on the other hand, things become more finely classified if I use child 
> packages.

That's OK, this is the purpose of child packages. But again, what do gain with an empty top package and having the world in a child, especially if every user has to with it?

> So, do you insist, that it should not be in a child library package?

No, I don't insist - after all, it's your code.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Should be in the root package or its child?
  2014-07-25  8:52     ` AdaMagica
@ 2014-07-25 12:20       ` Victor Porton
  0 siblings, 0 replies; 6+ messages in thread
From: Victor Porton @ 2014-07-25 12:20 UTC (permalink / raw)


AdaMagica wrote:

> On Thursday, July 24, 2014 6:21:40 PM UTC+2, Victor Porton wrote:
> 
>> package RDF.Raptor is
>>
>> end RDF.Raptor;
> 
> What do you gain with an empty package?

Empty packages are meant to facilitate hierarchy.

>> But on the other hand, things become more finely classified if I use
>> child packages.
> 
> That's OK, this is the purpose of child packages. But again, what do gain
> with an empty top package and having the world in a child, especially if
> every user has to with it?
> 
>> So, do you insist, that it should not be in a child library package?
> 
> No, I don't insist - after all, it's your code.

-- 
Victor Porton - http://portonvictor.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-25 12:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23 18:58 Should be in the root package or its child? Victor Porton
2014-07-23 19:02 ` Victor Porton
2014-07-24  9:06 ` AdaMagica
2014-07-24 16:21   ` Victor Porton
2014-07-25  8:52     ` AdaMagica
2014-07-25 12:20       ` Victor Porton

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