Skip to content

Latest commit

 

History

History
63 lines (39 loc) · 2.79 KB

File metadata and controls

63 lines (39 loc) · 2.79 KB

CE4101-AvastCE 🛡

Simple example of an application of the strategy design pattern, we implement an "antivirus" 🛡

Strategy Design Pattern

Problem 📛

One of the dominant strategies of object-oriented design is the "open-closed principle".

Figure demonstrates how this is routinely achieved - encapsulate interface details in a base class, and bury implementation details in derived classes. Clients can then couple themselves to an interface, and not have to experience the upheaval associated with change: no impact when the number of derived classes changes, and no impact when the implementation of a derived class changes.

problem

Structure 🧩

The Interface entity could represent either an abstract base class, or the method signature expectations by the client. In the former case, the inheritance hierarchy represents dynamic polymorphism. In the latter case, the Interface entity represents template code in the client and the inheritance hierarchy represents static polymorphism.

strategy

Example

AvastCE 🛡

For the example of this tutorial we will make a mock of an antivirus. AvastCE antivirus has many types of scans: quick scan, deep scan, file scan and others. Not all scans can be run in the free version, for deep scans you must have a pro account. We will use the Strategy pattern to implement the different types of scans that can be run.

example

Review the implementation of Java code and discover the potential of using the Strategy pattern in the solution of your projects.

Docs 📖

You can find much more about how to use this project in our documentation section

Authors

This project has an excellent development group formed by ITCR computer engineering students

Project developed at the Technological Institute of Costa Rica | 2021 🄯

License 📄

This project is licensed under the MIT License - see the LICENSE.md file for details