How to structure classes in the filesystem?

Posted by da_b0uncer on Programmers See other posts from Programmers or by da_b0uncer
Published on 2012-11-29T12:44:37Z Indexed on 2012/11/29 17:17 UTC
Read the original article Hit count: 604

I have a few (view) classes.

Table, Tree, PagingColumn, SelectionColumn, SparkLineColumn, TimeColumn.

currently they're flat under app/view like this:

app/view/Table
app/view/Tree
app/view/PagingColumn
...

I thought about restructuring it, because the Trees and Tables use the columns, but there are some columns, which only work in a tree, some who work in trees and tables and in the future there are probably some who only work in tables, I don't know.

My first idea was like this:

app/view/Table
app/view/Tree

app/view/column/PagingColumn
app/view/column/SelectionColumn
app/view/column/SparkLineColumn
app/view/column/TimeColumn

But since the SelectionColumn is explicitly for trees, I have the fear that future developers could get the idea of missuse them.

But how to restructure it probably?

Like this:

app/view/table/panel/Table

app/view/tree/panel/Tree
app/view/tree/column/PagingColumn
app/view/tree/column/SelectionColumn

app/view/column/SparkLineColumn
app/view/column/TimeColumn

Or like this:

app/view/Table
app/view/Tree

app/view/column/SparkLineColumn
app/view/column/TimeColumn

app/view/column/tree/PagingColumn
app/view/column/tree/SelectionColumn

© Programmers or respective owner

Related posts about object-oriented

Related posts about file-structure