Skip to main content
spelling corrected
Source Link
gnat
  • 20.5k
  • 29
  • 117
  • 310

I want to write a classeclass which offeroffers two sequences of elements to its users. The first one (lets call it "primary") is the main of the class and will be use 80% of the time. The second one (lets call it "secondary") is less important, but still need to be in the same class. The question is: what interface should the class offer to its users?

This problem came in the context of an exerciceexercise in which I am writing a simple database access framework. Here are the classes involved in the question:

The table class consistconsists of a sequence of columns and an other sequence of rows. The main use of the table is manipulating (access, add and remove) the rows.

I want to write a classe which offer two sequences of elements to its users. The first one (lets call it "primary") is the main of the class and will be use 80% of the time. The second one (lets call it "secondary") is less important, but still need to be in the same class. The question is: what interface should the class offer to its users?

This problem came in the context of an exercice in which I am writing a simple database access framework. Here are the classes involved in the question:

The table class consist of a sequence of columns and an other sequence of rows. The main use of the table is manipulating (access, add and remove) the rows.

I want to write a class which offers two sequences of elements to its users. The first one (lets call it "primary") is the main of the class and will be use 80% of the time. The second one (lets call it "secondary") is less important, but still need to be in the same class. The question is: what interface should the class offer to its users?

This problem came in the context of an exercise in which I am writing a simple database access framework. Here are the classes involved in the question:

The table class consists of a sequence of columns and an other sequence of rows. The main use of the table is manipulating (access, add and remove) the rows.

Add a "Context" section explaning the relationship between the different classes
Source Link
authchir
  • 370
  • 3
  • 13

Context

This problem came in the context of an exercice in which I am writing a simple database access framework. Here are the classes involved in the question:

  • table
  • column
  • row
  • field

The table class consist of a sequence of columns and an other sequence of rows. The main use of the table is manipulating (access, add and remove) the rows.

Deeper in the hierarchy, a row is made of column and field so a user can ask the value (field) corresponding to a given column or column name. Each time a column is add/modify/remove from the table, every rows will need to be modify to reflect the modification.

I want the interface to be simple, extensible and combining well with existing code (like STL or Boost).

Context

This problem came in the context of an exercice in which I am writing a simple database access framework. Here are the classes involved in the question:

  • table
  • column
  • row
  • field

The table class consist of a sequence of columns and an other sequence of rows. The main use of the table is manipulating (access, add and remove) the rows.

Deeper in the hierarchy, a row is made of column and field so a user can ask the value (field) corresponding to a given column or column name. Each time a column is add/modify/remove from the table, every rows will need to be modify to reflect the modification.

I want the interface to be simple, extensible and combining well with existing code (like STL or Boost).

edited title
Link
authchir
  • 370
  • 3
  • 13

What kind of interface should a double container offer?

Source Link
authchir
  • 370
  • 3
  • 13
Loading