Posts by Caffé • 17,429 points
254 posts
-
4
votes2
answers201
viewsA: Interface with the same class name
An interface is a declaration of a type, and a class is also a declaration of a type. Types must have distinct names in context/scope. Otherwise, during type consumption, the compiler/interpreter…
-
30
votes6
answers6389
viewsA: What is a legacy code?
It is a code that was already present before the code that is intended to write now and is related to the code that is intended to write now, but it was not written predicting this relationship. In…
-
6
votes3
answers8119
viewsA: What are the best practices in field validation?
In fact has a lot of code repetition there and you have reason to be worried. C# provides great object orientation features to favor reuse and prevent code repetition. You can generalize the code,…
-
4
votes4
answers332
viewsA: In relation to object orientation, should queries have a class of their own or can they stay in a specific class?
A basic principle accepted in Object Orientation is the separation of responsibilities. Behold Principle of Separation of Responsibilities for more details. Four responsibilities A widely used…
-
2
votes3
answers1231
viewsA: How does the Oracle Express Edition database work?
Oracle Express Edition is identical to Enterprise editions, having only license and capacity limitations (base size, number of users, concurrent performance, etc.). The problem you are facing is…
-
1
votes2
answers125
viewsA: DDD return aggregate entity of an AR
Ddd is not for developing a blog I understand you’re trying to exercise the concept, but a blog is not a good context to exercise DDD because a blog is too simple a domain - it does not offer the…
-
15
votes2
answers2818
viewsA: What is "Inversion of Dependency Principle" (DIP)?
What is Dependency Inversion Principle? The Principle of Inversion of Dependence seeks to keep the focus of the design task in business, leaving this design independent or decoupled from the…
-
13
votes3
answers1255
viewsA: What is SRP and how is it used?
What is SRP? The Single Responsibility Principle ("SRP" or "Principle of Single Liability"), determines that each component of the system shall have only one responsibility. Bringing to Object…
-
5
votes5
answers1899
viewsA: Is dealing with business rules in the model bad practice?
Treating business rules in Model is bad practice? On the contrary. Model is the right place for business rules. Being precious The validation of whether the piece was outside the board is a business…
-
5
votes2
answers1434
viewsA: How does a Container work?
What is a container In this case, we call container what will support our app running. That is, our application does not have enough code to run alone, it needs someone to load it into memory,…
answered Caffé 17,429 -
7
votes3
answers5026
viewsA: How to identify classes in an object-oriented system?
TL;DR Problem analysis and solution design are deeply connected, speak the same language, and only this language (the language of business). The technological implementation is disconnected from…
-
11
votes1
answer3372
viewsA: Sql - Select first and last record
There you go: select lote_ticket.id_lote, processo.id_setor, min(processo.dt_inicio) as dt_inicio, max(processo.dt_inicio) as dt_final from tb_processo as processo join tb_lote_ticket as lote_ticket…
-
1
votes5
answers42558
viewsA: How to delete data from a table with dependencies in other tables
When you manipulate data from a database, it is assumed that you know the database, or you would not know what you are doing. Disabling the constraints temporarily solves? I don’t think so because…
-
2
votes1
answer254
viewsA: Possibility to drag a form with the mouse when its title bar has been hidden
You will need to transfer the drag messages received by the component that visually replaces the title bar to the actual title bar that you have hidden. To do so, you can: Use the Windows API by…
-
4
votes3
answers2089
viewsA: How to implement business rules or system rules using Domain Driven Design in C#?
This is not a domain rule so it should not reside in the domain layer. Login and login details are rules of application and not business. Security, in general, are non-functional requirements…
-
5
votes1
answer765
viewsA: What is the difference between Web Service and Application Service?
This unanswered question so far shows that the difference between "Application Service" and "Web Service" cannot be described in the right way; nor in the wrong way. "Application Service" even has a…
-
7
votes3
answers637
viewsA: Is it correct to state which interface solves the multiple inheritance problem in Java?
Multiple inheritance seeks to solve two problems: to) The ability of a polymorphic object to take the form of objects of distinct hierarchical chains. b) The ability of an object to reuse object…
-
2
votes1
answer57
viewsA: Property instantiated by Castle being recorded in Database as Proxy
You can use the Tostring When saving the value of any property in the bank you would use the method ToString() value. Depending on how you write to the bank this is already being done. So when the…
-
11
votes2
answers329
viewsA: Domain-Driven Design and Requirements Survey
Interesting you see understanding of the domain and requirements as two distinct processes. I’ve never seen it this way. For me, knowledge of domain comes during the lifting of requirements. But I’m…
-
11
votes1
answer10730
viewsA: What is the difference between sendRedirect and requestDispatcher.forward?
The difference is between redirect the customer to a page (sendRedirect) and forward a request to be met by another resource (forward). In the first case (sendRedirect), the client will receive an…
-
8
votes2
answers2572
viewsA: Main purpose of utility classes
What is a utilitarian class It would be nice if the question offered a definition of "utility class" to ensure that we’re talking about the same thing. I will assume that utility class is one that…
-
9
votes5
answers1656
viewsA: Create objects within a list without for/foreach C#
The answers they use Enumerable.Repeat have a potential problem: it creates a repeat of values, that is, if the object passed by parameter is a Reference type (a class, for example), copies of the…
-
5
votes1
answer1311
viewsA: How to create a simple interpreter?
A few years ago I needed to allow the user to configure species of labels. Basically he wrote a text more or less like this: Valor medido: {valor_medido}, Valor considerado: {valor_medido * 0.9}…
-
4
votes3
answers339
viewsA: Connection to the bank is open in static method?
MeuEntities is a class generated by Entity Framework, inheriting from Dbcontext, right? Life cycle of the connection Using the Entity Framework, you do not control the life cycle of the connection…
-
4
votes2
answers249
viewsA: How to specify that the constructor type is equal to the one declared in the class?
You are creating the instance in the "wrong way" You are not creating an instance of your class Generic, so the compiler is accepting a different type in the constructor without error. This way you…
-
1
votes1
answer53
viewsA: Doubt "Maven-archetype-webapp" template
I’d also like to know why you don’t create. In fact, I’d just like you to create it (you wouldn’t even have to tell me why you never created hehehe). But the fact is that it does not create and you…
-
1
votes4
answers1114
viewsA: Create string array in C#
Solution Since one attribute accepts a Type as a parameter (provided that it Type is derived from the expression typeof), you can use the "creativity". So you need the attribute receive a string…
-
8
votes1
answer1032
viewsA: Basic difference between Abstract Factory and Factory?
The name of Pattern until it is quite significant. Basically, Abstract Factory is the technique of using a Factory abstracting the knowledge of the concrete implementation of that Factory. The same…
pattern-designanswered Caffé 17,429 -
9
votes3
answers3377
viewsA: How does the MVC framework for Desktop applications work?
What is MVC The definition of MVC has been evolving over time. In fact it has been greatly simplified. In fact this term was born well before the WEB applications and today it is even difficult to…
-
5
votes4
answers850
viewsA: Return all equal items from different groups
Solution: select A.GRUPO from TABELA A join TABELA B on B.OBJETO = A.OBJETO where B.GRUPO = 1 group by A.GRUPO having count(A.OBJETO) = (select count(OBJETO) from TABELA where GRUPO = 1) and…
-
1
votes1
answer1470
viewsA: Pick a string from a textbox when pressing the Enter key
You can associate the code that will use the content of Textbox with an event that is triggered when a key is pressed while the Textbox has the focus. You can use the event Keydown of the component…
-
2
votes3
answers1701
viewsA: How to represent "is-one" relationships in the logical model?
If you need to model your clients by identifying whether they are a natural or legal person, you could have simply two entities: Person, whose identity would be his national register, a field called…
-
0
votes3
answers187
viewsA: Omitting Else is a good idea in some cases, right?
What is the function of Else? Is to provide the code that must be executed in the case of (and only in the case of) the condition of the if not be true. In your example, in the case of the condition…
-
12
votes1
answer9352
viewsA: Differences between JSF and JSP
Differences between JSF and JSP Strictly speaking, they are technologies of different scope: JSP is a framework* for building views while JSF is a framework* for the entire presentation layer, based…
-
2
votes2
answers608
viewsA: Show zero in group by SQL Server
You can "simulate" a table with all existing status and then make a select on this table by linking it through a left Join with the table Ordem, thus: declare @Status Table ( Status int) insert into…
-
31
votes2
answers14936
viewsA: What is Event-Oriented Programming?
What is event-oriented programming? It’s when you write code to respond to events. In event-oriented programming, a routine specializing in monitoring events warns the specific code to respond to a…
-
2
votes1
answer9015
viewsA: How to create a. BAT configuration file in windows?
Although I find your solution creative, I use another technique to have a kind of common configuration file for my batch files. BAT (or batch files): My configuration file is itself a file. BAT,…
-
12
votes3
answers8360
viewsA: Property x Attribute
Definition Modern, high-level programming languages serve nothing but to express a model, express domain rules, so a conceptual dialogue is important for those who want to improve themselves as a…
-
2
votes3
answers101
viewsA: Is there any justification for this change? Change in variable pattern
There is absolutely no difference between one and the other except the reading of the code by a human. The alias figure as a keyword (keyword) of the language, but the use, function and operation is…
-
25
votes6
answers13840
viewsA: What good is a builder?
Yes, you can work without implementing code in the class constructor. The main utility of implementing the object constructor is to require parameters without which the object cannot live without,…
-
4
votes3
answers466
viewsA: Best practice to check if the module is being used
Manually treating competition in bank changes trying to ensure data integrity takes a lot of work and usually doesn’t work right. Your solution, for example, has this problem of keeping blocked…
-
2
votes1
answer372
viewsA: Delimited Context and Modules/Packages
Several Packages ("packages") can compose a single bounded context ("bounded context"), there is not necessarily a relation of 1 to 1. A structure named after package that works well is:…
-
7
votes4
answers1851
viewsA: Infer class type from a generic
Java does not maintain the type of Generic after the compilation (he makes such a "type Erasure"). In other words, the type of the parameter Generic (or "type Parameter") cannot be rescued at…
-
6
votes1
answer1099
viewsA: What are the advantages of using namespaces in Delphi?
Advantages of using namespaces in Delphi Namespaces in Delphi aim to organize Units and types logically. Namespaces also serve to offer a global unique identifier for a type or Unit, so we can have…
-
4
votes2
answers490
viewsA: Doubts about the use of delegates
Delegate is a type of C# (and other . Net languages) that represents a particular method signature (defines the type of parameters and the return of the method). We can declare a delegate the same…
-
1
votes2
answers2051
viewsA: Develop integration tests correctly
When I test the API I must re-test the cases that have already been tested in the service? No, you mustn’t. The problem is not redundancy in the sense that the same code is run by tests at different…
-
7
votes1
answer308
viewsA: What is the use of indexers?
The utility is to provide a syntax to access, through the index, items of an object representing a collection. Say you create a class specializing in keeping a collection of cars and you want to get…
-
2
votes4
answers1394
viewsA: How to concatenate two byte arrays in Java?
byte [] terceiro = new byte[mensagem.length + nonce.length]; for (int i = 0; i < mensagem.length; i++) { terceiro[i] = mensagem[i]; } for (int i = mensagem.length; i < terceiro.length; i++) {…
-
2
votes2
answers320
viewsA: SQL Server - Doubt update and relation between tables
The expected, in fact, is yes that all lines of material are updated. See your last command: update material set nomeColMat = nomeCol from coletor where cpfCol = @cpfColetor The above command makes…
-
4
votes1
answer2239
viewsA: Is it worth developing in Javafx for Web, Mobile and Desktop?
Instead of answers I hear only crickets singing. It seems to me that it is not consolidated no. Nor can it be bet because it is already very old. Web interface Companies that decide the direction of…