I believe that it is helpful for you to develop a library management system (reconstructed version) by many people
Project premise
[project premise] master the basic syntax of java familiar with use process control understand object-oriented ideas proficient in encapsulation, inheritance and polymorphism be familiar with the use of the interface and avoid any abnormality be familiar with using collection be familiar with I/o flow relate ...
Posted by ClanCC on Thu, 23 Dec 2021 05:38:29 +0100
06 ChainOfResponsibility responsibility chain mode
Scenario 1
A website that can leave comments, send messages, etc. The message is input through the front end, then transmitted to the back end, then entered into the database, and then displayed on the website. If the text contains a web page script, it will destroy our web page; If sensitive words are included, it will have a more serious imp ...
Posted by tomtomdotcom on Thu, 23 Dec 2021 04:39:33 +0100
Learning of common design patterns
1. Design pattern
1.1 overview:
Software Design Pattern Software design pattern, also known as design pattern, is a set of code design experience that is repeatedly used, known by most people, classified and catalogued. It describes some recurring problems in the process of software design and the solutions to the problems. In other words, it ...
Posted by ex247 on Wed, 22 Dec 2021 22:11:19 +0100
Design pattern --- abstract factory pattern
Abstract factory pattern
To learn the abstract factory pattern, we must first understand the factory pattern In the factory method mode, only products of the same grade are considered, but in real life, many factories are comprehensive factories, It can produce multi-level (variety) products, such as raising animals and plants on the farm, pro ...
Posted by Jaguar on Wed, 22 Dec 2021 18:39:53 +0100
Design pattern: abstract factory pattern C + + implementation
preface
Today, I reviewed the abstract factory pattern. Before that, I reviewed the simple factory pattern and factory method pattern. Their functions are the same: to encapsulate the creation process of objects. If you are not familiar with simple factory mode and factory method mode, you can read the previous article: Simple factory mo ...
Posted by agent_smith_sp on Wed, 22 Dec 2021 06:50:29 +0100
Common design patterns
Learning address:
Dark horse design pattern
1. Six design principles of design mode
1.1 principle of single responsibility
The responsibility of a class should be single, and a method does only one thing. Try to change for only one reason.
1.2 Richter's replacement principle
All references to the base class must be able to be replaced ...
Posted by ben2005 on Tue, 21 Dec 2021 23:25:27 +0100
[design mode] Flyweight Pattern
🔥 core
Meta sharing mode reduces the memory occupied by objects by sharing the same state shared by multiple objects.
The essence of meta mode is caching.
🙁 Problem scenario
You are a game map modeler, building complex game maps.
Now, you need to build a forest. There are thousands of trees in the forest. No tree has attributes ...
Posted by Admin32 on Tue, 21 Dec 2021 22:20:04 +0100
[design mode] memo pattern
🔥 core
Memo mode captures the internal state of an object and saves the state outside the object,
This allows you to restore the object to its original saved state later.
🙁 Problem scenario
You are a poster designer twenty years ago. Recently, a powerful graphics editing software (PS) was born, and you became the first batch of ...
Posted by crazy/man on Tue, 21 Dec 2021 20:32:47 +0100
Design mode - command mode
1, Basic introduction
English Name: CommandConcept: encapsulate a request into an object, so that you can parameterize the client with different requests, queue requests or record request logs, and provide command revocation and recovery functionsMode type: structuralDesign principle:Main features:
2, Realize
Requirements: requirements chang ...
Posted by lizzyd on Tue, 21 Dec 2021 06:05:32 +0100
Dynamic agent mode
Proxy pattern is a common design pattern in Java development. The design purpose is to insert other functions between service class and customer class. The inserted functions are transparent to the caller and play the role of camouflage control
1. Static proxy mode
Characteristics of static agent
1. Target role fixed
2. Get the target rol ...
Posted by wildcolour on Tue, 21 Dec 2021 03:18:45 +0100