Click here to Skip to main content
15,890,355 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello there, I've been thinking to start a more complex project to learn how to work with MVC programming, but I don't really understand how it works, and haven't been very lucky so far on my research.
It would be really useful if someone could put some light in there

I've made a simple project building a calculator with this architecture, but I still can't abstract it to other scenarios.

In my model layer I had my calculator class, with just the 'calc' method which either added or substracted both operands, besides operands/op setters and result getter. Also it's builder.

The controller just had a method which would create an instance of a calculator and set the values of the operands and operation and return the result.

The View picked up the values of the textboxes once you either clicked +/- and sent them to the controller.

I don't know if what I did it's ok, nor how to, for instance, create an application to register people on a database. Where would the sql sentences be?

I know I'm really lost here, thanks for your time!
Posted
Comments
BillWoodruff 1-Nov-14 21:05pm    
There are excellent tutorials and examples on MVC here on CodeProject; how about studying them ?

1 solution

Hello,
For bellow

"I don't know if what I did it's ok, nor how to, for instance, create an application to register people on a database. Where would the sql sentences be?"

Your UI or interface must be in View
Model will contain Detabase related query , now controller will be bridge
in between them.

Here is some link for you hope this will help :)

Learn MVC (Model view controller) Step by Step in 7 days – Day 4[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900