Activity 2 Demop

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

ACTIVITY 2:

“Elaborate a report”

ING. TECNOLOGÍAS DE LA INFORMACIÓN

ÁREA DESARROLLO Y GESTION DE SOFTWARE

PRESENT:

ALEGRIA MTZ ARLETH JACQUELINE

CD. REYNOSA, TAMAULIPAS ENERO 2024.


What is software architecture?
software architectures Software architecture consists of different types of patterns
that, when creating a program, help in its planning and construction. Its importance
lies in the fact that it is carried out to meet requirements and produce structures
that allow changes easily.

Types of software architectures


There are different types of software architectures , among which you can find:

✓ Client-server
✓ Peer to peer network
✓ Model-view-controller (MVC)
✓ Event-oriented architecture (EDA)
✓ Microservices Architecture

Client-server
This type of software architecture pattern refers to the existence of a server that
provides a service to a client (person or company). When the client requests certain
data from the server, the server accepts the process and delivers the data requested
by the client.
Among the advantages of this pattern, it is taken into account that all the
data is in the same place , it requires little maintenance and data recovery is possible.
As disadvantages, clients can be affected by viruses, trojans and phishing .
Additionally, servers are prone to denial-of-service attacks (also known as DoS
attacks), and data can be modified during transmission.
Peer to peer network
Better known as a peer-to-peer network , it is one of the software architectures that
allows sharing a large amount of data. Unlike the client-server model, this consists
of a decentralized network of clients and servers . All parts consume resources,
without the need for a centralized server.
One of its great benefits is that, due to the lack of a central server, costs are lower,
so it can be more economical . On the other hand, as a disadvantage, if one of the
peers is attacked by a virus, the possibility is high that it will carry that same virus
to the rest of the peers connected on the network.

Model-view-controller (MVC)
The MVC pattern is used because it allows you to separate components of a program
based on the responsibility of each one, therefore, if a modification is required to be
made to a specific part of the code, the rest remains intact.

It uses three components: model, view and controller. The model takes care of the
data, whether it is updates, searches or other. The controller receives the client's
orders to subsequently request the data from the model and communicate to the
view, which is the visual representation of the data (graphical interface).

In this type of software architectures , the development process is faster, since


several developers can work at the same time. Furthermore, the modifications, in
the same way as with the previous pattern, do not affect the entire architecture.
However, as far as the disadvantages are concerned, we can point out that it is a
complex pattern . Developers must be properly trained to work with assigned parties.

Event-oriented architecture (EDA)


To understand this type of software architectures , it is important to know that we
refer to events in a different way. Commonly, an event is spoken of as a social event,
but the event in this case consists of a change in the state of an application.
It differs from other software architectures because it is asynchronous and
distributed, mainly used for creating scalable applications. Its components do not
communicate synchronously. The expected result is that applications send events
and other components react to them, processing them and generating new events.

Among its advantages, event-oriented architecture is characterized by its flexibility.


Because event processing components have only one responsibility, if a change
occurs, a single component is isolated, leaving the rest unchanged.
Although event-driven architecture is essential for companies that need to service
millions of requests, it also has its drawbacks. For example, asynchronous solutions
are difficult to decode.
Microservices Architecture
Microservices architecture is one of the most sought after today. It consists of the
creation of software components that are dedicated to performing a single task and
are self-sufficient, so they evolve independently.

It is also worth clarifying that, when we refer to microservices, we are talking about
small programs (applications) that provide services in order to solve certain tasks.
As a great advantage, the microservices architecture stands out for its encapsulated
components , since they can evolve at the required speed and each microservice
can be developed with different technologies (databases).

Lastly, if we focus on the disadvantages, this type of software architecture needs a


good team that can manage the components correctly, since it can be a bit
complicated.

What do you understand for "design pattern"?


Design patterns are a general, reusable and applicable solution to different software
design problems . These are templates that identify problems in the system and
provide appropriate solutions to general problems that developers have faced over
a long period of time, through trial and error.
These patterns provide a structured and reusable approach to solving recurring
situations in software development. Design patterns help developers communicate
and share efficient and effective solutions that have proven successful in the past.
Each design pattern serves a specific purpose and offers a solution to a common
design problem. By using a design pattern, developers can leverage accumulated
experience and avoid reinventing the wheel, resulting in more efficient,
maintainable, and scalable software.

Explain in detail 2 of them.

Factory Method
Also called: Factory method, Virtual Builder

Purpose
Factory Method is a creational design pattern that provides an interface for creating
objects in a superclass, while allowing subclasses to alter the type of objects to be
created.

Applicability
✓ Use the Factory Method when you do not know in advance the exact
dependencies and types of the objects your code must work with.
✓ Use the Factory Method when you want to offer users of your library or
framework a way to extend its internal components.
✓ Use the Factory Method when you want to save system resources by reusing
existing objects instead of rebuilding them each time.

How to implement it
1. Make all products follow the same interface. This interface should declare
methods that make sense across all products.
2. Add an empty Factory Method pattern inside the creator class. The return
type of the method must match the common interface of the products.
3. Finds all references to product constructors in the code of the creator class.
One by one, replace them with invocations to the Factory Method, while
extracting the product creation code to place it inside the Factory Method.
4. You may need to add a temporary parameter to the Factory Method to control
the type of product returned.
5. At this point, the Factory Method code may look pretty ugly. You might have
a switchlong operator that chooses which product class to instantiate. But
don't worry, we'll fix it right away.
6. Now, create a group of creator subclasses for each product type listed in the
Factory Method. Overrides the Factory Method in subclasses and extracts the
appropriate pieces of constructor code from the base method.
7. If there are too many product types and it doesn't make sense to create
subclasses for all of them, you can reuse the control parameter of the base
class in the subclasses.

Pros and cons


✓ You avoid a strong coupling between the creator and the specific products.
✓ Single responsibility principle . You can move the product creation code to
one place in the program, making the code easier to maintain.
✓ Open/closed principle . You can incorporate new types of products into the
program without breaking existing client code.
 The code may become complicated, as you must incorporate a multitude of
new subclasses to implement the pattern. The ideal situation would be to
introduce the pattern into an existing hierarchy of creator classes.
Singleton
Also called: Single instance

Purpose
Singleton is a creational design pattern that allows us to ensure that a class has a
single instance, while providing a global access point to that instance.

Applicability
✓ Use the Singleton pattern when a class in your program should only have one
instance available to all clients; for example, a single database object shared
by different parts of the program.
✓ Use the Singleton pattern when you need tighter control of global variables.

How to implement it
1. Adds a private static field to the class to store the Singleton instance.
2. Declare a public static create method to get the Singleton instance.
3. Implements lazy initialization within the static method. You must create a new
object on your first call and place it inside the static field. The method must
always return that instance in all subsequent calls.
4. Declare the class constructor as private. The static method of the class will
still be able to invoke the constructor, but not the other objects.
5. Goes through the client code and replaces all direct calls to the Singleton
instance's constructor with calls to its static creation method.
Pros and cons
✓ You can be certain that a class has a single instance.
✓ You get a global access point to that instance.
✓ The Singleton object is only initialized when it is first required.
 It violates the Single Responsibility Principle. The pattern solves two problems
at the same time.
 The Singleton pattern can mask bad design, for example, when program
components know too much about each other.
 The pattern requires special treatment in a multi-threaded environment, so
that multiple threads do not create a Singleton object multiple times.
 It can be difficult to unit test Singleton client code because many testing
frameworks rely on inheritance when creating mock objects. Because the
Singleton class is private and, in most languages, it is impossible to override
static methods, you will have to think of an original way to simulate the
Singleton. Or just don't write the tests. Or don't use the Singleton pattern.

Mention the most popular mobile development


frameworks.

Flutter
Flutter is a free and open-source framework from Google that allows you to create
native applications for Android and iOS with a simple code base. It
is an innovative software development kit for developing cross-
platform applications. It stands out for its new way of creating
native applications. It is a reliable smartphone UI framework to
develop engaging apps quickly by accelerating development.

Flutter mobile app development framework has features like:


✓ High performance applications.
✓ Ability to preview changes.
✓ Easy to learn.
✓ Designs that consume less resources.
✓ Economic.
✓ Community and documentation.
✓ Improve productivity.

The cons of Flutter:


 Apps made with Flutter are the heavy ones.
 Flutter-based apps are not compatible with web applications.
 It's pretty new, so you'll have to write a lot of things from scratch.
 You will have to learn to use Dart.

Bibliography
https://www.teclab.edu.ar/tipos-de-arquitecturas-de-software-cuales-hay-y-en-
que-se-diferencian/
https://refactoring.guru/es/design-patterns/factory-method
https://refactoring.guru/es/design-patterns/singleton
https://spdigitalagency.com/es/blog/popular-frameworks-in-2023-for-mobile-
application-development

You might also like