Questions tagged [hierarchy]
The hierarchy tag has no summary.
50 questions
0
votes
1
answer
113
views
How to refactor parallel inheritance tree?
I have a (php) program, which must change yearly. This program calculates tax for every year and there are sometime changes in requirements.
First, the user fills their incomes, expenses, etc.
Then ...
2
votes
1
answer
1k
views
Does passing a view model down to a properties violate MVVM or OOP?
I'm new to MVVM but experienced in OOP. I have an easy solution to my problem, but I'm not sure if it violates MVVM or OOP or if it is a good practice.
I have a set of ViewModel classes in my WPF ...
3
votes
1
answer
1k
views
Strictly only importing modules in subdirectories: is this a good rule?
I'm making my 1st official project. It's written in Python, is open-sources, and I'd like people to be able to freely and easily fork and modify the code. The project name is "shelf" and the ...
3
votes
1
answer
2k
views
How can I provide a class diagram for a system that contains creation of an object that contains a combination of property?
I am designing a system that contains organizational hierarchy management. There are four roles in the system which are the user, admin, manager and head of procurement:
I am trying to let the ...
1
vote
1
answer
944
views
Database Design - Hierarchical Structure [closed]
1
We are trying to redesign a database that currently holds thousands of parameters for different datatypes and currently has a flat data structure.
We generate XML files from the database, which ...
-2
votes
3
answers
656
views
Does Java Have True Single Inheritance? [closed]
I've been doing some studying on the types of inheritance. From what I've learned:
Single inheritance refers to when a class inherits another class.
Multi-level inheritance refers to when a class ...
1
vote
1
answer
98
views
code for a try_run() invocation - where do I place it?
I'm working on a CMake module which, at some point, invokes try_run(). The file I'm compiling is not really part of the project's sources - it's not used anywhere. It's only ever useful for CMake, to ...
0
votes
1
answer
130
views
Express unique recursive task system
I would like to express a task as either itself or a container for other tasks (recursively). The problem is that each task has to be one of two fundamental types: a goal or a routine. And, children ...
9
votes
3
answers
14k
views
DDD: Is an aggregate root responsible for deleting its child entities from their repository?
I am developing a large software project using DDD (Domain-Driven Design). I have an entity that acts as an aggregate root, let's call it Root. This entity refers to a collection of child entities of ...
98
votes
12
answers
17k
views
My client wants 25% of comments in my current project, how to react? [closed]
junior developer here.
I am currently working alone on a web application for a big client of my company. I started last month.
The client wants at least 25% of comments in each of its software ...
1
vote
2
answers
186
views
Abstract composition hierarchy with multiple implementations
I need to implement a class hierarchy and be able to implement it in multiple ways.
I want to create a logical representation of a query language, and then be able to parse it to/from different ...
2
votes
2
answers
1k
views
WPF/C#: What is the accepted way for a lower level object to notify the UI?
Setting
Let's take the following example:
We have a series of entertaining events on the television with each lasting only an hour and this goes on for 3 weeks. We want to create a simple App that ...
1
vote
2
answers
2k
views
How to design the datamodel of nested categories connected to a note?
I am building a personal app to store my notes in. It is not a new concept, of course, but it is giving me a great project to learn Node.JS together with trying out a graph database: Neo4j.
What I am ...
3
votes
4
answers
139
views
Structure when I need multiple "copy" instances of a common base class?
So I'm building a card game where each card has cost, damage, and durability, as well as name and description. Obviously one would think of creating a Card class:
class Card {
int cost
int ...
0
votes
1
answer
83
views
How to organise tree of sub-classes which should interact?
I'm writing a trading framework in MQL and I'm confused how I should organise my class hierarchy.
|-- Terminal (Log)
| |-- Market
| | |-- Chart
| | | |-- Draw
| |-- Account
| | | |...
1
vote
0
answers
108
views
Hierarchical data structure: pull requests + pull request reviews + pull request review comments
GitHub has:
pull requests
pull request reviews
pull request review comments
BitBucket has only:
pull requests
pull request comments
So there are three kinds of objects.
I write code ...
1
vote
0
answers
147
views
Should all classes and interfaces ultimately derive from one Class, and how does this affect type safety?
If I have "Object" as the top level class, then I have various interfaces, ISomething, ISomethingB, ISomethingC, then I have Class x,y,z, all ultimately deriving from the class Object (these ...
0
votes
2
answers
1k
views
Designing Table To Store Hierarchy
I have a table Company and User like below...
Company Table:
CompanyID CompanyName etc...
User Table:
UserID Email UserType CompanyID etc...
First I must tell you that, currently ...
1
vote
1
answer
3k
views
Managing permissions in hierarchical groups
I'm currently writing a web application for our small company which was originally just planned to organize appointments more efficiently by displaying our customer structure and automatically plan ...
3
votes
1
answer
2k
views
RESTful nested resources
I have a profile resource. Profiles can have a parent and an arbitrary number of child profiles.
What's the best way to model this in a RESTful scenario?
I thought of a number of different solutions,...
0
votes
1
answer
107
views
Reflexive calls of objects in the same hierarchy
I am not sure how to phrase this. I believe this should have been asked somewhere, but I am unable to find it because I don't know the keywords.
Basically, I have some types like this:
interface Foo
...
2
votes
1
answer
1k
views
Data Storage Architecture: Storing Hierarchical Data (JSON/BSON)
Say you have the hierarchical storage concept of "Foo." "Foo" holds an id, various values, and zero to many "Foo." Obviously, in turn, the child elements can hold zero to many Foos. The data is purely ...
1
vote
3
answers
924
views
How can one think of a relational schema in terms of storing it in a NoSQL database?
Recently I've been wanting to experiment with NoSQL databases, especially document store ones. After reading, I still don't understand how one might model information that is contained in a relational ...
1
vote
1
answer
67
views
Approach for comparing versions of hierarchy
I'm looking for a language agnostic approach for the following. We are prototyping this in both relational and graph DBs, so, again I'm open to hearing all opinions with respect to those.
Here is ...
6
votes
3
answers
357
views
Handling retroactively adjusted data that is reported hierarchically
Several of our customers have come to us with an interesting problem that involves adjusting data that occurred in the past which is rolled up and reported based on an org hierarchy.
For example: If ...
-1
votes
2
answers
236
views
Per my design requirements, does this design hierarchy seem reasonable?
Background
Construction
Note that I am using C# here, but it may not be necessary to provide input to my conceptual questions about design. Consider the following design methodology...
I work at a ...
6
votes
3
answers
601
views
What would be a good approach to generate a tree of folders?
Say I have an array of strings, like this:
var folders = new[]
{
"Foo",
"Bar",
"Foo\Bar"
"Foo\Bar\Baz"
};
And that I have an object that represents a folder - something like this:
...
16
votes
5
answers
872
views
How to make a datatype for something that represents either itself or two other things
Background
Here's the actual problem I'm working on: I want a way to represent cards in the card game Magic: The Gathering. Most cards in the game are normal-looking cards, but some of them are ...
0
votes
3
answers
2k
views
Multi inheritance in Java
Let's say I've got a generic java class Filter<InputType, OutputType> which receives an input object and transforms it to an output object.
Now I've got two other classes (NoInputFilter<...
4
votes
3
answers
3k
views
Is this OOP class hierarchy too deep?
So I am making a Super Mario Bros NES clone in pygame and for all enemies that are drawn to the window, I have a class hierarchy that is 5 classes deep. Going in the order of:
Object (A base class for ...
6
votes
1
answer
1k
views
Should I always throw the most specific or should I try to generalize exception types?
Say you normally have FooException.
/**
* @throw FooException If Foo is invalid for searching.
*/
public bool exists(Foo a)
But at some point you need to have two more specific exceptions for Foo.
...
0
votes
1
answer
126
views
Where should I put (wrapper) scripts in my source tree? [closed]
I have this software package which installs itself to /usr/local/mypackge, with a bunch of subdirs. In bin/ I have linked code, as ELF executables, in /share/doc I have documents, etc. Now suppose I'...
9
votes
1
answer
3k
views
In MVC should a model contain subview models?
Some background:
A colleague and myself have different interpretations of MVC which means, given the same problem, we are coming up with radically different solutions. He comes from a Java background ...
6
votes
3
answers
3k
views
Reducing dependency cycles and reducing coupling
I'm trying to learn how to produce quality object-oriented code and have been studying concepts like SOLID. I'm currently working on an entity-component-process system for a small game engine.
...
0
votes
0
answers
117
views
How to structure my java packages [duplicate]
I have a Java library, quite a huge one.
I'm asking regarding Best Practices of structuring the source.
For example, the logging sybsystem:
Option 1: All in one package, named to sort nicely
Log - ...
0
votes
2
answers
1k
views
Is hierarchical product backlog a good idea in TFS 2012-2013?
I'd like to validate I'm not in the wrong way.
My team project is using Visual Studio Scrum 2.x. Since each area/product has a lot of kind of requirements (security, user interface, HTTP/REST ...
2
votes
2
answers
1k
views
HMVC and Database Connections
Whilst I have good experience with OOP, I'm fairly new to the concept of (H)MVC. I understand the basic concept of modular design that comes with HMVC, it's the great attraction of it. But one thing ...
6
votes
2
answers
1k
views
Are there established algorithms for spacing out objects of unequal size?
I'm working on visualizing a hierarchy. There will be clusters of objects, each cluster containing rectangles of fixed width but variable height. I'd like to arrange these within a rectangular space ...
4
votes
2
answers
237
views
Should package structure closely resemble class hierarchy?
Pretty simple question. Should package structure closely resemble class hierarchy? If so, how closely? Why or why not?
For instance, let's say you've got class A and class B, plus class AFactory ...
-1
votes
1
answer
204
views
How to write a program that diffs on hierarchy changes? [closed]
Why is it that diff programs work on a line-by-line basis instead of a hierarchal one?
All code can be expressed in a hierarchy, even though it's not immediately apparent.
Most of the data we work ...
1
vote
2
answers
950
views
Scrum Master in the organization
I'm wondering how to set up the organization with Scrum Masters. I would prefer to see real examples of where the scrum masters are located in the organization's hierarchy and how report-to / chain-of-...
3
votes
1
answer
2k
views
How to organize my site's file system properly?
Doing some reading on Stack Overflow, I've found a lot of information suggesting that proper organization of a file system is crucial to a well-written web app. One of the key pieces of evidence is ...
5
votes
1
answer
318
views
Contract / Project / Line-Item hierarchy design considerations
We currently have an application that allows users to create a Contract. A contract can have 1 or more Project. A project can have 0 or more sub-projects (which can have their own sub-projects, and so ...
13
votes
3
answers
3k
views
How can you tell whether to use Composite Pattern or a Tree Structure, or a third implementation?
I have two client types, an "Observer"-type and a "Subject"-type. They're both associated with a hierarchy of groups.
The Observer will receive (calendar) data from the groups it is associated with ...
1
vote
1
answer
512
views
How should the cppcms template hierarchy be used
I understand that the hierarchy, in cppcms for templates, goes skin (topmost, representing a namespace), then view (representing a class) and finally template (representing a function).
I want to ...
1
vote
1
answer
75
views
Can thesaurus items have more than one USE relation?
I want to model a Thesaurus using the ANSI/NISO standard relation description like "broader term", "narrow term", etc. (see this Wikipedia article for details). Is it valid for a Thesaurus item in ...
6
votes
2
answers
1k
views
Should exceptions of a subclass extend the superclass exceptions or my own namespace?
Our library extends another (third-party) library. When we create a child class in our library, and want to throw exceptions, should those exceptions extend the exceptions from the parent class or ...
3
votes
1
answer
387
views
The usual metadata objects or: How to move a typical ExtJS App to jQuery, and: What's missing in the middle?
I have entered into an existing project that is all about maintaining nested data structures. You have companies which are assigend to accounts, and contacts and notes and... basically the usual bunch ...
2
votes
3
answers
637
views
Separating the database, API, and the interface
Most of my projects start small. Many times I start with a web page (1 file) that has the code to...
select stuff from the database => display it to the user and offer editing => receive the edits (...
2
votes
4
answers
310
views
How can I make tagging work for the concept of "all"?
There's an approach to organising information that says that hierarchy is a tool of the devil, or at least is overrated. I've embraced this understanding for a data-driven site I'm working on which ...