All Questions
Tagged with databaseobject-oriented
47 questions
19votes
3answers
22kviews
Why aren't Object Oriented databases used as much as Relational Databases? [closed]
I have come across many relational database management systems (RDBMS). But recently I used hibernate which made me start wondering why Object Oriented databases aren't more popular. If object ...
18votes
4answers
4kviews
How do I know my data is relational or object oriented in nature?
Just read these lines- If your data is object in nature, then use object stores ("NoSQL"). They'll be much faster than a relational database. If your data is relational in nature, the ...
18votes
4answers
2kviews
Staying OO and Testable while working with a database
What are some OOP strategies for working with a database but keeping things unit testable? Say I have a User class and my production environment works against MySQL. I see a couple possible approaches,...
14votes
3answers
5kviews
General thought process for "How would you build this website/app" interview questions [closed]
I've collected a bunch of interview questions like "Describe how you would design a photo album application", "Describe how you would design this particular feature of this particular website" (e.g. ...
8votes
4answers
18kviews
Can anyone explain this one-to-one, one-to-many, many-to-one, many-to-many concept with respect to ORMs?
A lot of ORM sites and SQL tutorials mention these relationships as if they are obvious or to be taken for granted, but I don't fully understand why the distinctions need to be made. Consider two ...
7votes
3answers
301views
How to model and store an entity which has "one or more" values
I'll use C# to design the model to be persisted Let's suppose I have the following entity: public class Episode { public int Id { get; set; } public string Title { get; set; } public ...
5votes
1answer
308views
is it common sense to convert database data to object first?
In the framework I am using, I shall group things into models, controller, and views (I added services). When getting things out from database, it is pure data in array form. So they won't have ...
4votes
2answers
259views
Why are dependencies typically reversed when representing complex objects as relational tables?
I'm going through some sort of phase where I over analyze and second guess every single decision I make when attempting to write software that has preventing me from getting anything done. I recently ...
4votes
3answers
1kviews
OOP and relational databases [duplicate]
I see a lot of talk in the OOP world about principles and laws such as Open/Close and Loose Coupling, I can understand how they are so high valued, However I seem to have ran into a problem with ...
4votes
2answers
2kviews
Should methods be part of your persisted entities?
We are coding a small game and have a Player class. This Player class has certain properties which you would persist in a database like Id, Level, Health. We would like a Player to be able to kill ...
3votes
3answers
257views
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 ...
3votes
1answer
2kviews
Check if object exists before updating/deleting
In an application that doesn't use an ORM, is it good practice to check whether an object exists before attempting to update/delete it? For example: @Route(method="DELETE", path="/posts/\d+") ...
3votes
1answer
1kviews
OOP - Should I set the database connection as `public` for other classes to use it, although it might be unsafe?
I have a basic Database class, and it has a mysqli property (an object itself) which contains the connection information. Other classes uses this class to read and manipulate the database. There are ...
3votes
1answer
839views
Read Only Generic data access layer Best practice
I am trying to write some art of "generic" data access library to access the data of my company's ERP Software, which is our main/core application where all our related data is managed. I am a ...
3votes
1answer
1kviews
Domain Driven Design with an EAV database model
How can one apply DDD to a EAV database model? Consider this EAV database model: How am I supposed to build a domain model if all my entities and their attributes will be stored in the database? ...