Timeline for Trying to clearly seperate my logic in my program
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 3, 2012 at 11:01 | comment | added | Cohen | For example: Your controller would create an instance of the Man-class setting defaults if necessary. The controller passes the Man-class to the userinterface, after the user interface is done editing it will return the changed Man-class to the controller. The controller will now execute the necessary actions to save (create/update/delete) the Man-class using methods of the dataAccess class. | |
Dec 2, 2012 at 6:19 | history | bounty ended | Matt Rohde | ||
Dec 2, 2012 at 6:19 | vote | accept | Matt Rohde | ||
Dec 1, 2012 at 6:17 | comment | added | Matt Rohde | @Bobson I understand what you're saying, but am having a hard time picturing it in my code, could you perhaps provide a simplified coding sample of how the CRUD should be divided between Controller, View, and Model? | |
Nov 30, 2012 at 15:14 | comment | added | Bobson |
@MattRohde - UserInterface (View) calls the controller. Controller calls DataAccess (Model). View doesn't interact with Model directly. For example: You have a "Save receipt" button on the view. That calls Controller.SaveReceipt(ReceiptData data) . That, in turn, breaks ReceiptData down into the appropriate changes to the database.
|
|
Nov 29, 2012 at 1:09 | comment | added | Matt Rohde |
@bobson I am not sure how to move the CRUD functions in Program to the DataAccess Class without also moving references to the UserInterface class to within the DataAccess class too. And according to this post I'm not supposed to make the UI interact directly with EF layer.
|
|
Nov 28, 2012 at 20:31 | comment | added | Bobson | @MattRohde - Ideally, UserInterface would be a base type for each interface you'd actually show (like Mvc.View is for websites), but for this you probably don't need that. If you do want to go the formal MVC route, though, you might want to look into libraries to help. | |
Nov 28, 2012 at 19:51 | comment | added | Matt Rohde | @bobson I see, well, this program has only one view, the UserInterface Class, so the controller would function to swap out other UserInterface-like classes if the program had them? | |
Nov 28, 2012 at 14:12 | comment | added | Bobson | @MattRohde - The controller generally uses data objects to populate a view model, then chooses the correct view to display. A view model contains just the information needed for the view to do its work, and can be populated from several different database objects. | |
Nov 28, 2012 at 1:25 | comment | added | Matt Rohde |
so if user's input methods are defined in the view aka UserInterface then what kinds of things should program aka controller do so i may justify doing mvc so i can practice, learn, and demonstrate that I understand it to a potential employer?
|
|
Nov 27, 2012 at 12:28 | history | answered | Cohen | CC BY-SA 3.0 |