During interviews, I often ask what are 8 of the 23 design patterns in J2EE

Updated on technology 2024-03-10
17 answers
  1. Anonymous users2024-02-06

    Generally used:

    factory

    singleton

    These two are more.

    Proxy (** mode).

    adapter mode

    command

    observer

    Facade (façade mode).

    These will also be encountered.

    Template MethodDecorator

    Iterator (iterative subpattern).

    These are rarely encountered.

    As for the rest, it is unlikely that you will encounter it, and you will only use it if you meet certain conditions.

    What to prepare for the written interview:

    The written test of the design pattern is mainly the first 3 demos, which are simple implementations, such as the lazy and hungry mode of a singleton.

    During the interview, the design pattern mainly asks about the benefits of the design, as well as the application scenarios.

    How to break ???

    Personally, I think that by understanding the basic implementation of these design patterns, you should be able to understand how and why these patterns are used.

    Recommend GOF's book.

  2. Anonymous users2024-02-05

    In general, design patterns fall into three broad categories:

    There are five types of creation mode: factory method mode, special genus elephant factory mode, singleton mode, builder mode, and prototype mode.

    There are seven structural modes: adapter mode, decorator mode, ** mode, appearance mode, bridge mode, combination mode, and enjoy yuan mode.

    There are 11 behavioral patterns: policy mode, template method mode, observer mode, iterative sub-pattern, chain of responsibility mode, command mode, memo mode, state mode, visitor mode, mediator mode, and interpreter mode.

    In fact, there are two types: concurrent mode and thread pool mode.

    The most commonly used are: Factory Mode, Singleton Mode, Builder Mode, ** Mode.

    In fact, it is better to know them all.

  3. Anonymous users2024-02-04

    Abstract Factory Pattern, Chain of Responsibility Pattern

    Proxy pattern

    Command pattern and observer pattern I will have these few, it is easy to understand, it is really difficult to understand the subtleties of it, don't be greedy, it is very useful to understand one.

  4. Anonymous users2024-02-03

    A total of 23 design modes!

    Quote from the book "Software Secrets - Design Patterns".

    According to the purpose, design patterns can be divided into creative patterns, structural patterns, and behavioral patterns.

    The creative mode is used to handle the process of creating objects; Structural patterns are used to deal with combinations of classes or objects; Behavioral patterns are used to describe how classes or objects interact and how responsibilities are assigned.

    The creative mode is used to deal with the process of creating objects, and mainly includes the following five design patterns:

    Factory Method Pattern Abstract Factory Pattern Builder Pattern Prototype Pattern Singleton Pattern Structural patterns are used to deal with the combination of classes or objects, and mainly include the following 7 design patterns:

    Adapter Pattern Bridge Pattern Composite Pattern Decorator Pattern Facade Pattern Flyweight Pattern **Proxy pattern) Behavioral patterns are used to describe how classes or objects interact and how responsibilities are assigned, and include the following 11 design patterns:

    Chain of responsibility pattern

    Command pattern Interpreter pattern Iterator pattern Meditor pattern Memento pattern Observer pattern State pattern Strategy pattern pattern) template method pattern visitor pattern

  5. Anonymous users2024-02-02

    I'll tell you what I encountered when I was looking for a job, and I usually ask you about the singleton pattern, the observer pattern, the factory pattern, and most importantly, the MVC pattern.

  6. Anonymous users2024-02-01

    There are many design patterns that we don't need because many of them are low-level implementations, such as the Iterator pattern, which is used to design an interface for traversal in the JDK. I think: in fact, what you need to master is singletons, factories, chains of responsibility, and dynamics, because these design patterns are very classic, and the object-oriented multi-too, abstraction, and inheritance are used to the fullest...

  7. Anonymous users2024-01-31

    Just take a look ... Don't pattern for the sake of pattern.

  8. Anonymous users2024-01-30

    If writing a program is compared to fighting, then the design pattern is a routine, such as Changquan, Yongchun or something.

    It's all fights, some are heroes, and some are hooligans.

    But sometimes the hero is not necessarily too big for the hooligan, because the hooligan does not play according to the routine.

    The hooligan is a cow, it's amazing, the hooligan's fighting method has slowly become a new routine, and the hooligan has programmed the hero.

    That's the way the design pattern is, at first GOF was four hooligans who were about the same as us, but there were many fights, they paid attention to summarizing and analyzing, and sorted out a set of routines from the group fight, which is the GOF23 mode, so they became heroes.

    If you want to become a hero, it's right to learn the routines first, but you should also pay attention to the practical application and don't die the routines. Combine routines to slowly form your own style, and you will not be a hooligan.

  9. Anonymous users2024-01-29

    Not at the beginning of development, but only when there are places where a certain pattern fits.

    Depending on the project, the usage pattern will change, and the development companies I know of use the design pattern more often in the second and third versions of the project!

    The book is a primer, and the real project doesn't have to be a design pattern.

  10. Anonymous users2024-01-28

    Frameworks are formed by design patterns.

    There are more than 23 design patterns in real development.

    One of the most common MVC design patterns is used almost every day.

    When you look at the source code of Hibernate, Spring, Struts, etc., you will find that design patterns are everywhere.

    When you go to use a temple, there is a façade model, a strategy model, a ** model and other experiences in the development of the model is the model.

    Don't think that there are only 23 design patterns, and you can even summarize one pattern yourself.

  11. Anonymous users2024-01-27

    Use less. The slightly more commonly used patterns are: singleton and factory.

  12. Anonymous users2024-01-26

    No, he's a combination of multiple design patterns.

  13. Anonymous users2024-01-25

    MVC is a design idea that is higher than a design pattern.

  14. Anonymous users2024-01-24

    It should not be among the 23 design patterns of the GOF. MVC is more of an architectural pattern.

  15. Anonymous users2024-01-23

    MVC is a composite design pattern.

  16. Anonymous users2024-01-22

    There are too many J2EE patterns, and there is a classic book on the J2EE model, but in fact, there is not a complete summary there.

    There are 23 basic object-oriented patterns, so I recommend taking a look at "Talking about Design Patterns - Starting with Object-Oriented".

  17. Anonymous users2024-01-21

    The Gang of Four design pattern is powerful.

Related questions
6 answers2024-03-10

Yes, it can be evolved, but it has to evolve one level at a time, and it has to be a flower ingot.

18 answers2024-03-10

Now it's also a voucher.

If you are in the law, you can bring a few trumpets to dot the treasure boxes and treasure chests when the sky drops treasure boxes and treasure chests. >>>More

13 answers2024-03-10

Copycat version and genuine version, just look at the appearance, the appearance is different, for example, the copycat version of the red bear is 3 chairs, even if it is combined to 5, it is still 3 times, it is still red, and the genuine 5 itself is black. In the lower right corner of the game interface, there is one? You can find detailed information on various pets and chairs there.

9 answers2024-03-10

Do you want to PK or 3 force 1 min plus phase point earth force bb gold head tuo is also 3 force and one min plus, remember that the speed of bb must be more than 100 faster than your speed. The most ideal blood bb is the spirit cloud deer.,You should find that the spirit is higher than the turtle's other bb defense.,It's best to be faster than you.。

42 answers2024-03-10

Take a green water and apply it, it will be purple for 70 minutes, blue for 80 minutes, and red after 90 minutes, after that, you should pay attention to it, apply it gently, and apply it for 100 minutes to make the equipment fade and turn white. >>>More