comp.lang.ada
 help / color / mirror / Atom feed
* Interface to aggregated type
@ 2012-08-06 18:42 ms
  2012-08-06 19:43 ` Dmitry A. Kazakov
  2012-08-06 19:56 ` Marius Amado-Alves
  0 siblings, 2 replies; 4+ messages in thread
From: ms @ 2012-08-06 18:42 UTC (permalink / raw)


My question is half-ada/half-architectural, I'll explain it on simple HTTP server example.

Imagine HTTP library providing two packages - `Headers` which provides container for HTTP headers (`Header_Container` type) and `Requests` which is a abstraction over HTTP request message (`Request` type).

Clearly `Request` aggregates `Header_Container`, as HTTP requests generally contain some set of headers.

My dilemma is - `Headers` package already provides some sort of `Header_Container` manipulation interface - procedures for inserting and deleting headers and functions to return them, but I want allow these operations also on container aggregated inside `Request` type (which is probably a private record).

Now I have several options such as duplicating header manipulation interfaces entirely (eg. function Header_Value (R : Request, Name : String) in `Requests` package) or making aggregated `Header_Container` field public (can I make only some of the record's fields public and leave others private?). Both have pros and cons, and possibly even more solutions exist.

What would you do?



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

end of thread, other threads:[~2012-08-13  9:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-06 18:42 Interface to aggregated type ms
2012-08-06 19:43 ` Dmitry A. Kazakov
2012-08-06 20:28   ` ms
2012-08-06 19:56 ` Marius Amado-Alves

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