Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
A report on mvc using the information
1. Name: Toushik Paul , ID : 143-15-4497
Subject: Web Engineering
Submitted to: Dewan Ziaul Karim
Daffodil International University
ASSIGNMENT
2. What is Framework?
The word FRAMEWORK is thecombination of two words, i.e., FRAME and WORK. It means, one FRAMEhas already been
designed and developer has to WORK on that FRAMEto meet his/her project requirements. It’s just a tool, which helps a
developer to code better and faster.
In computer language, a Framework is a universal, reusable softwareplatformto develop softwareapplications, products and
solutions. In other words, we can say it is some kind of library, a piece of software, which provides web developers with code
base and consistent standardized ways of creating web applications.
Back when PHP and other technology started, developers were writing their own customcode for each functionality. Later, some
peoplerealized that, writing thesame code every time, in every page, not reusing it extensively, plain PHP is not so effective.
Afterwards, as the PHP object model developed (especially with thelaunch of PHP 5), framework development really came into
action and became so popular.
So, let’s check what are the key benefits of using a Framework, especially in PHP.
Organizing Code and File
The MVC Pattern
Enforcing of Good Coding Standards
Utilities and Libraries
Less Code & Faster Development
Security
Performance Tools
Simplified and Pretty URLs
Efficiently Access Database
WhatisMVC framework?
The Model-View-Controller(MVC) is an architectural pattern that separates an application into three main logical components:
the model, the view, and the controller. Each of these components are built to handle specific development aspects of an
application. MVC is one of the most frequently used industry-standard web development framework to create scalable and
extensible projects.
MVCComponents
Following are the components of MVC −
Model
The Modelcomponent corresponds to all the data-related logic that the user works with. This can represent either the data that is
being transferred between theView and Controller components or any other business logic-related data. For example, a Customer
object will retrieve the customer information from the database, manipulate it and updateit data back to the database or use it to
render data.
3. View
The View component is used for all the UI logic of the application. For example, the Customer view will include all the UI
components such as text boxes, dropdowns, etc. that the final user interacts with.
Controller
Controllers act as an interface between Model and View components to process all the business logic and incoming requests,
manipulate data using the Model component and interact with the Views to render the final output. For example, the Customer
controller will handle all theinteractions and inputs fromthe Customer View and updatethe database using theCustomer Model.
The same controller will be used to view the Customer data.
ASP.NETMVC
ASP.NET supports three major development models: Web Pages, Web Forms and MVC (Model View Controller). ASP.NET
MVC framework is a lightweight, highly testable presentation framework that is integrated with the existing ASP.NET features,
such as master pages, authentication, etc. Within .NET, this framework is defined in the System.Web.Mvcassembly. The latest
version of the MVC Framework is 5.0. We use Visual Studio to create ASP.NET MVC applications which can be added as a
template in Visual Studio.
ASP.NET MVC Features
ASP.NET MVC provides the following features −
Ideal for developing complex but lightweight applications.
Provides an extensible and pluggable framework, which can be easily replaced and customized. For example, if you do
not wish to use the in-built Razor or ASPX View Engine, then you can use any other third-party view engines or even
customize the existing ones.
Utilizes the component-based design of the application by logically dividing it into Model, View, and Controller
components. This enables the developers to manage the complexity of large-scale projects and work on individual
components.
MVC structureenhances the test-driven development and testability of the application, since all the components can be
designed interface-based and tested using mock objects. Hence, ASP.NET MVC Framework is ideal for projects with
large team of web developers.
Supports all the existing vast ASP.NET functionalities, such as Authorization and Authentication, Master Pages, Data
Binding, User Controls, Memberships, ASP.NET Routing, etc.
ASP.NetFramework:MVC, Web Api , Entity Framework ,Web Forms ,Empty Forms etc.
4. Example application using one of framework: In here we are using MVC and Entity Framework and
build and run this sample as-is, you must have Visual Studio 2013 or Visual Studio 2013 Express for Web installed. If you have
Visual Studio 2015, change theconnection string in theWeb.config file so that the SQL Server instance name is
MSSQLLocalDB instead of v11.0.
In most cases you can run the application by following these steps:
1. Download and extract the .zip file.
2. Open the solution file in Visual Studio.
3. Build thesolution, which automatically installs themissing NuGet packages.
4. Open the Package Manager Console, and run the update-databasecommand to create the database.
5. Run the application.
If you have any problems with thoseinstructions, follow theselonger instructions.
1. Download the .zip file.
2. In File Explorer, right-click the.zip file and click Properties, then in the Properties window click Unblock.
3. Unzip thefile.
4. Double-click the.sln file to launch Visual Studio.
5. From the Tools menu, click Library Package Manager, then Package Manager Console.
6. In the Package Manager Console (PMC), click Restore.
7. Each migration will run, then the seed method will run. You can now run theapplication.
Running the Sample
To run the sample, hit F5 or choose the Debug | Start Debugging menu command. You will see the home page which
includes a menu bar. (In a narrow browser window you'll have to click the symbol at the top right of the page in order
to see the menu).From this page you can select any of the tabs to perform various actions such as display a list of
students, add new students, display a list of instructors, and so forth.
Screenshots:
MVCsourceCode:
Conroller:
5. using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using practice_Much.Models;
using Practice2.Models;
namespace practice_Much.Controllers
{
public class RestauarantManagementController : ApiController
{
public ApplicationDbContext _Context;
private object foodItem;
public RestauarantManagementController()
{
_Context = new ApplicationDbContext();
}
[HttpGet]
[Route("api/Menu")]
public SetMenuVIewModel SetMenuVIewModel()
{
///var foodItem = _Context.FoodItems.GroupBy(p => p).ToDictionary(p => p.
Key.Name, p => p.ToList());
var setMenu = _Context.SetMenus.Include(a => a.SetMenuItem).ToList();
var menu = new SetMenuVIewModel() { SetMenus = setMenu, FoodCategories =
foodItem };
return menu;
}
}
}
Route Directory:
Model: using System;
using System.Collections.Generic;
6. using System.Linq;
using System.Web;
namespace Practice2.Models
{
public class SetMenuItem
{
public int Id { get; set; }
public SetMenu SetMenu{ get; set; }
public int SetMenuId { get; set; }
public FoodItem FoodItem { get; set; }
public int FoodItemId { get; set; }
public int Quantity { get; set; }
}
}
Reference
http://www.phpandstuff.com/articles/top-10-reasons-why-you-should-use-a-php-framework
http://code.tutsplus.com/tutorials/10-compelling-reasons-to-use-zend-framework--net-12214
https://code.msdn.microsoft.com/ASPNET-MVC-Application-b01a9fe8