You are on page 1of 8

ADAMA SCIENCE AND TECHNOLOGY

UNIVERSITY

Software design and architecture


Individual assignment
MVC (model-view-controller) architecture

MVC stands for model-view-controller.The MVC architecture pattern turns complex


application development into a much more manageable process. It allows several
developers to simultaneously work on the application. Model View Controller is a
predictable software design pattern that can be used across many frameworks
with many programming languages, commonly Python, Ruby, PHP,
JavaScript, and more. It is popularly used to design web applications
and mobile apps.

 Model: The backend that contains all the data logic.

- stores & manages data.

- Often a database.

- The model's job is to simply manage the data. Whether the data is from a database,
API, or a JSON object, the model is responsible for managing it.

 View: The frontend or graphical user interface (GUI)


- The view is a visual representation of the data- like a chart, diagram, table,
form.

 Controller: The brains of the application that controls how data is displayed.

- The controller connects the model and view. The controller converts inputs
from the view to demands to retrieve/update data in the model.

- The controller receives input from view, uses logic to translate the input to a
demand for the model, the model grabs the data, the controller passes data
from the model back to the view for the user to see in a nice display.

 The concept of MVCs was first introduced by Trygve Reenskaug, who proposed
it as a way to develop desktop application GUIs.Today the MVC pattern is used
for modern web applications because it allows the application to be scalable,
maintainable, and easy to expand.
 The architecture components of the MVC pattern are designed to handle different
aspects of an application in development. The MVC design pattern serves to
separate the presentation layer from the business logic.

Why should we use MVC? - separation of concerns, or


SoC for short.

- MVC design allows for Separation of Concerns - dividing the logic up


between the 3 buckets, so that each bucket can act independently.The
model, view, and controller don’t depend on each other. Generally,
software is worked on by teams - a team might have a designer, engineer,
and database architect. Separation of concerns means each team member can
work on their piece at the same time, because logic has been separated into
buckets. Separation of concerns is also great for maitenance - developers can
fix a bug in one piece of code, without having to check out the other pieces
of code.

The MVC pattern helps us break up the frontend and backend code into separate
components. This way, it's much easier to manage and make changes to either side
without them interfering with each other.

Benefits of MVC

 Traditionally used for Graphical user interfaces (GUIs)


 Popular in web applications
 MVC responsibilities are divided between the client & server,
compatible with web application architecture
 MVC is helpful design pattern when planning development
 Separation of Concerns: that code is divided based on function to
either the model, view, or controller bucket
 Works well with Ruby on Rails
 Loosely Coupled
 Removes unnecessary dependencies
 Reuseable without modification

Web application architecture

The web application architecture describes the interactions between applications,


databases, and middleware systems on the web. It ensures that multiple applications
work simultaneously.

Example - opening a webpage.

As soon as the user hits the go button after typing a URL in the address bar of a web
browser, it requests for that particular web address. The server sends files to the
browser as a response to the request made. The browser then executes those files to
show the requested page.
Finally, the user is able to interact with the website. The most important thing to note
here is the code parsed by the web browser. A web app works in a similar way.

This code might or might not have specific instructions that tell the browser how to
respond with respect to the different types of user inputs.

Hence, a web application architecture has to include all the sub-components as well as
the external applications interchanges for the entire software application, in the
aforementioned case, which is a website.

The web application architecture is indispensable in the modern world because a


major portion of the global network traffic, as well as most of the apps and devices,
make use of web-based communication.

A web application architecture has to not only deal with efficiency, but also with
reliability, scalability, security, and robustness.

How Does It Work?

 Client-side Code - The code that is in the browser and responds to some user
input
 Server-side Code - The code that is on the server and responds to the HTTP
requests

A web developer (team) developing the web application decides as to what the code
on the server will do with respect to the code in the browser. For writing server-side
code, C#, Java, JavaScript, Python, PHP, Ruby, etc. are used.

Any code that is able to respond to HTTP requests has the ability to run on a server.
The server-side code is responsible for creating the page that the user requested as
well as storing different types of data, including user profiles and user input. It is
never seen by the end-user.

A combination of CSS, HTML, and JavaScript is used for writing the client-side code.
This code is parsed by the web browser. Unlike the server-side code, client-side code
can be seen as well as modified by the user. It reacts to user input.
The client-side code communicates only via HTTP requests and is not able to read
files off a server directly.

Web Application Components

 UI/UX Web Application Components – This includes activity logs,


dashboards, notifications, settings, statistics, etc. These components have
nothing to do with the operation of a web application architecture. Instead,
they are part of the interface layout plan of a web app.

 Structural Components – The two major structural components of a web app


are client and server sides.
 Client Component - The client component is developed in CSS, HTML, and
JS. As it exists within the user’s web browser, there is no need for operating
system or device-related adjustments. The client component is a representation
of a web application’s functionality that the end-user interacts with.
 Server Component - The server component can be build using one or a
combination of several programming languages and frameworks, including
Java, .Net, NodeJS, PHP, Python, and Ruby on Rails. The server component
has at least two parts; app logic and database. The former is the main control
center of the web application while the latter is where all the persistent data is
stored.

Service oriented architecture

Service-Oriented Architecture (SOA) is a stage in the evolution of application


development and/or integration. It defines a way to make software components
reusable using the interfaces.Formally, SOA is an architectural approach in which
applications make use of services available in the network. In this architecture,
services are provided to form applications, through a network call over the
internet. It uses common communication standards to speed up and streamline the
service integrations in applications. Each service in SOA is a complete business
function in itself. The services are published in such a way that it makes it easy for
the developers to assemble their apps using those services.

There are two major roles within Service-oriented Architecture: 

1. Service provider: The service provider is the maintainer of the service and the
organization that makes available one or more services for others to use. To
advertise services, the provider can publish them in a registry, together with a
service contract that specifies the nature of the service, how to use it, the
requirements for the service, and the fees charged.

2. Service consumer: The service consumer can locate the service metadata in


the registry and develop the required client components to bind and use the
service.

Advantages of SOA: 

 Service reusability: In SOA, applications are made from existing services.


Thus, services can be reused to make many applications.
 Easy maintenance: As services are independent of each other they can be
updated and modified easily without affecting other services.
 Platform independent: SOA allows making a complex application by
combining services picked from different sources, independent of the platform.
 Availability: SOA facilities are easily available to anyone on request.
 Reliability: SOA applications are more reliable because it is easy to debug
small services rather than huge codes
 Scalability: Services can run on different servers within an environment, this
increases scalability

Disadvantages of SOA: 
 High overhead: A validation of input parameters of services is done whenever
services interact this decreases performance as it increases load and response
time.
 High investment: A huge initial investment is required for SOA.
 Complex service management: When services interact they exchange
messages to tasks. the number of messages may go in millions. It becomes a
cumbersome task to handle a large number of messages.

You might also like