[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Can't wrap my head how I'm supposed to model some things

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 17
Thread images: 1

File: images.jpg (5KB, 200x200px) Image search: [Google]
images.jpg
5KB, 200x200px
Can't wrap my head how I'm supposed to model some things while programming, it happens time and time again.
Latest example I'm trying to make something imdb-ish, put some movies and series, but also would want to be able to divide series into seasons and seasons into episodes. While in a way series and movies are on the same "level"(as if you want to show all the titles you have available), also are the episodes and movies on the same "level"(as if you want to mark something as "watched".
All this while sufficiently generic so I could also add books, anime, etc.
I feel like I probably skipped some step while learning OOP or something, maybe some material I could read about "choosing" how to model things into objects.
>>
>>52486771
This is a great question that I wish somebody would answer.
>>
>>52486816
It's seems to be more of a statement, rather a question.
>>
Sorry, I've not made it clear, I want to know if there's any material to read about "choosing" how to model things into objects.
>>
Look into OO Software Design with UML and GRASP-patterns.
>>
flowchart?
>>
rebump
>>
SICP
>>
Maybe you're not supposed to wrap your head around it all.

Shit like IMDB probably has multiple people on the team each designated a certain aspect. You're probably expecting too much of yourself.
>>
What language are you using? Are you just building the db with pure sql? What you described is really easy with django.
>>
>>52487817
I was using mongodb, but I don't think the problem is on this point. It's more about being able to solidly construct classes that could be interpreted in various ways.

Going to take a look at the recommendations when I go home.
>>
>>52487767
Imdb is an SQL database that is also designed like shit. They have two different tables for actors and actresses for fuck's sake.
>>
>>52487875
You just need define one to many relationships between your models. I have no idea how to do that in mongo
>>
>>52486771
Take a look at the alternate movie database. It's a good place to start learning about modelling this sort of stuff.
>>
Each type is a container type capable of holding more types.
Use composition, minimal inheritance.
Easy.
A show may contain seasons, just as a season may contain episodes, an episode acts, and a trilogy hobbits.
>>
>>52486771
id/parent_id tree structure with a row type (ex. video)
>>
https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model

Look into databases. That's what U R doing.
Thread posts: 17
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.