All Questions
Tagged with database-design object-oriented
22
questions
1
vote
1
answer
329
views
Representing database tables as objects
I'm building an address book API, where a user can input multiple contact names, phone numbers, and addresses.
My database structure would be as follows:
create table user (
id int not null primary ...
0
votes
1
answer
114
views
Time consideration in multiplicity of classes
In the following image, regarding a CD shop that rents its music CDs.
My question is regarding the correct multiplicity of X. I can think of several possibilities for X:
X= 1..1 as each copy of ...
-4
votes
1
answer
507
views
Efficient database for multiple key searching?
I'm trying to implement a solution that stores every product from a shop, and then allows me to search them either by ID (an integer index), description (string) or barcode (string).
The idea I came ...
1
vote
2
answers
94
views
What's the best convention to store "other" option?
Say I have a Person object. I need to ask the user to choose from a list, which laptop they have.
They can also choose the option "My product isn't listed here".
Now the Person object will look ...
1
vote
2
answers
156
views
How to manage item locations in an inventory
I have to manage item locations and life cycle as a new requirement. I'm not familiar in warehousing/inventory/storage systems, so maybe my question is trivial.
The task:
We have original items that ...
0
votes
1
answer
926
views
Is it good practice to create a static class for database tables calculations?
I need to implement some system (using python pandas dataframe in my case) that parses raw data, then adds on calculated data, and then validates that calculated data (boolean output on some columns)
...
3
votes
3
answers
238
views
How can I mark one of a 1:n relation as the "default"?
I have an "easy" question, but since I am not a very experienced programmer I would like to hear what some of you have to say.
If I have for example a Db called MyDb with many tables. Two of them are ...
-1
votes
2
answers
242
views
Hierarchy in ER and OO Model
So, it might be a very fundamental question, but I'm pretty confusing right now...
It's all about Element and ElementCategory: an element belongs to a category, a categoty can have many elements - a ...
-1
votes
1
answer
110
views
How should I handle an object that has copies of another object?
I really hope this is a good place to ask this since the answers might be subjective, but here it my problem:
This is probably irrelevant, but I'm working with Python and Django here.
I have the ...
1
vote
1
answer
4k
views
Class Design for JPA Entities with Multiple Tables Referring to Same Business Object
I have an application that works with products from various external data sources (in DataSourceProduct) and it also maintains its own version of the product (in MasterProduct). Here's the DB schema:
...
0
votes
2
answers
66
views
Filtering Deleted Objects
Picture a simple messaging app written in Django.
Users have the option to delete messages at any time, but the messages need to be retained in the database. There are two options:
A deleted ...
1
vote
0
answers
97
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 ...
2
votes
1
answer
794
views
Handling insertion to database with Repository pattern
I have a design question for working with databases in object-oriented PHP.
I have a table in my database called products. Then I have 2 classes for this table in my PHP project. ProductsRepository....
3
votes
2
answers
2k
views
many to many relation in database schema and oop class diagram
I have Student and Group entities. Student can have many groups and Group can have many students too. so in database I should have middle class and change many-to-many relation to one-to-many and many-...
0
votes
2
answers
333
views
Dealing with several custom getters
I have a data structure with data units containing different types of data. I've wrapped the data in "Field" objects so that each field is able to independently parse user input in a desired way.
...