Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9133723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:32:14+00:00 2026-06-17T08:32:14+00:00

Here’s an example structure of the DB I have: In the Student view form,

  • 0

Here’s an example structure of the DB I have:

enter image description here

In the Student view form, I’ve added the form to add a file.

In the Student Controller, when I create or update an entry, I manage the file upload and the creation of the File database entry.

What I want to know is, in the MVC design pattern, what is the right way to do this ? Is it that my Student controller must be aware of the way my File model is done and must know how to add a file?

Or the best way to do this would be that in my Student controller, I call the add or update action of the File controller? But in that way, am I breaking the MVC ?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:32:15+00:00Added an answer on June 17, 2026 at 8:32 am

    Ways you are breaking the MVC:

    • controller being responsible application logic and maybe even persistence (it should only be changing the sate of model layer and view)
    • model is not any single class, it is a layer made up from different classes with different responsibilities (there is no “file model” or “”student model”)

    In best case scenario, the controller would have no feedback from data, that it passed on to model layer (preferably through some service, that would be dealing with application logic withing domain model layer).

    Instead the view instance, when it starts to assemble the response for the user would check up on model’s state (through services again), to see if there has something changed. In case of an upload, this would be the point where view discovers the result of your upload and, based on data, decides how to respond. Usually in case of file upload the response will contain only a HTTP location header.

    I am assuming that you are talking about MVC in context of web, based on your profile history. In classical MVC the view would have know about changes in model layer without explicitly checking it, because of the observer pattern which is used there.

    While you most likely will have some “upload controller”, it should not directly interact with domain objects or storage abstractions. Instead it just takes a user’s request, extract data from it and passes it where it needs to go.

    Keep in mind, that in web applications the “user” is a web browser, not the person that works with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my problem.. I have the option to create(add) two new input fields,
Here's the setup - I have a view that lists products. On that same
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here is the code in a function I'm trying to revise. This example works
Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
Here is the Javascript I currently have <script type=text/javascript> $(function() { $('.slideshow').hover( function() {
Here is my SQL script CREATE TABLE tracks( track_id int NOT NULL AUTO_INCREMENT, account_id
I have just tried to save a simple *.rtf file with some websites and
Here's my problem I have this javascript if (exchRate != ) { function roundthecon()
Here is what I want to do. Use this HTML line and have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.