[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
Can't wrap my head how I'm supposed...
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

You are currently reading a thread in /g/ - Technology

Thread replies: 17
Thread images: 1
File: images.jpg (5 KB, 200x200) Image search: [iqdb] [SauceNao] [Google]
images.jpg
5 KB, 200x200
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 replies: 17
Thread images: 1
Thread DB ID: 445581



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

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

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 shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.