Questions tagged [Patterns of designing] (428)

1
answer

How to pass an argument to a function object of a class inside its private method?

I created a CRUD model for the database table in the form of Active Record. If the validation and saving of some fields in the models execute additional operations. The class was quite large. To make the architecture of the code more understandable, I have divided some of the fields into groups and made their logic in a sep...
Alice.Ebert asked April 19th 20 at 12:11
0
answer

How to implement communication objects data in advance of unknown type through an interface?

There are 2 objects, A and B, nasledovanie from one interface. The object A stores some data requested B. what has been achieved - B requests the data and gets it, that's just how it is seen by the code is the exchange of rows, it is necessary that the data type of the advance was unknown. Understand what interface methods ...
Keshaun.Pri asked April 18th 20 at 12:51
1
answer

How to access methods of the object through the interface?

Example: there are 2 isolated object A and B inherited from an interface, it is necessary that the object A has received the access methods B through a single interface method. How to implement it because the objects know nothing about methods each other. Come to mind are template virtual function, but to collect all in a h...
Bryon.Wilderman46 asked April 18th 20 at 12:39
1
answer

Dependency injection(di) == aggregation?

Actually the question in the title. By definition: Aggregation is the technique of creating new class from existing classes by including them. Dependency injection is the process of providing the external dependencies of a software component. In my opinion "by including them" == "enable external dependencies". Am I right...
Jordy asked April 16th 20 at 11:06
3
answers

What is mvc pattern really?

Web development are more than 8 years, including 5 years of commercial experience. Because of the specificity of the industry in which you work (cms letter B), have not had to deal with the mvc pattern. There have been many attempts to deal with this, read tons of similar articles where the essence of the pattern describe ...
santa.Berge asked April 16th 20 at 10:31
1
answer

Why to use the Builder pattern if you can pass an array to the constructor?

Read on the resources that one of the reasons to use the pattern Builder is an object creation with lots of parameters. But why not just use the array passed to the constructor?
asia_Schultz asked April 16th 20 at 10:13
0
answer

What is the replacement for MVC in gui?

And whether it is necessary the controller can MVVM be better?
tessie_Koe asked April 9th 20 at 10:01
2
answers

Why do we need abstraction in OOP?

Why the pattern is implemented using the abstraction of pow? You can't just register these methods in the regular classroom?
linda.Mar asked April 9th 20 at 09:52
0
answer

How to catch an active event in the stream?

Let's just say each event should something occur. Let event 5: [ 1, 2, 3, 4, 5 ] And each event is a function which changes the background color. Question: How to bind event s to functions to which they relate, ie when the event occurs 3 need to the color of the window turns red and when the event occurs 1 - white well,...
Emery_Stracke asked April 9th 20 at 09:30
1
answer

Java interface for the entity/dto or the transfer method in the link?

I'm trying to create a validator class with a few simple validation rules. These rules can be applied equally to different types of Hibernate entity (or DTO), and I would like to unify the class without creating different implementations. I'm trying to do this using generics, but the problem is that, although each type of ...
elvera_Marvin13 asked April 8th 20 at 18:39