30
    Jan
    2025
    1

    DECORATOR

    The Decorator pattern is a structural design that allows you to improve or change the behavior of objects at runtime. This is done by creating a set of decoration classes used to wrap the components. Each decorator adds a specific functionality or behavior to the component, and you can stack multiple decorators to create various combinations. In this section we implement the model under spring. Implementing the Decorator Pattern in Spring Let’s illustrate the Decorator pattern with a fun example about a user with various roles who can create a practice, but by role type you can create different practices...
    Read More
    29
    Jan
    2025
    0

    STRATEGY

    With the strategic model we define multiple algorithms and let the client application pass the algorithm to use as a parameter. Depending on the different interface implementations, the objects execute the method in different ways. For our case we have various reports that give different results and different searches depending on the type and we will try to implement different strategies for the search and the report in csv format based on the type we pass. First of all we will create the interface for the strategy pattern, in our case to create the report we create IReportServiceStrategy.java Implementing the...
    Read More
    28
    Jan
    2025
    0

    FACTORY

    Factory design pattern is used when we have a superclass with multiple subclasses and based on the input, we need to return one of the subclasses. This pattern removes the responsibility of instantiating a class from the client program to the factory class. The case addressed was for the creation of a practice that could be created differently depending on the user role. The approach was to create various classes depending on the user role and then instantiate the class based on the role in the factory. Implementing the Factory Pattern in Spring Let’s illustrate the Factory pattern with a...
    Read More
    27
    Jan
    2025
    0

    Design Pattern in spring

    I found a lot of documentation on patterns for various languages ​​but also how to use it on different frameworks, but apart from a few examples to explain what it consists of I never had the impression that they were used outside of an academic context. After all, over the years I have never seen the application of a pattern in real cases unless it was used internally in some framework. Since I consider design patterns an excellent approach for solving various cases, I would like to put some real cases that I had to face with the application of...
    Read More
    26
    Jan
    2025
    0

    Preface

    How these pages came about – I’m not a writer, and certainly not a super IT expert, but I’d at least like to write some guidelines with examples that might help others in the IT world. Based on my experience, which dates back to when I finished my degree in Computer Engineering in 2002, up until today, working with various companies from small to large on projects across different sectors, the Italian IT landscape I’ve encountered consists of people who definitely know how to tackle problems and find solutions. However, to be honest, every time I faced a problem or...
    Read More