I am an unexperienced computer science student and while making projects for different courses a few conceptual questions occurred.
Say I am to develop a website similar to imdb, but for music, from scratch and I want to list some artists on the frontpage. The database schema is already done with all its relationship and attributes, and there is a table artists. Should my server-side artist-class contain all table columns and relationships at creation time even it is not necessarily needed at that time? Or should I construct these objects with minimal parameters (like id, name) and get all the rest when needed (resulting in more individual sql statements) via helper-methods? I know that there is maybe no definitive answer except for 'it depends' or boils down to personal preference, but maybe there is even a consensus. If someone could name or link to resources to read up on things like this I would be very grateful, I didn't know what to search for exactly. Thanks.
PS: For people wondering why I don't ask these questions in the CS course; they are mostly held by students/assistants who only had to pass the course and don't have that much experience themselves.
Aucun commentaire:
Enregistrer un commentaire