I came across a rather unusual way of creating a class object on this blog: http://marchwicki.pl/blog/2010/11/building-a-pojo-in-an-elegant-way/ . This is a good way to do it. What are the benefits?
I came across a rather unusual way of creating a class object on this blog: http://marchwicki.pl/blog/2010/11/building-a-pojo-in-an-elegant-way/ .
This is a constructor design template with a free interface .
, ( , " " ), , :
.
" "
2 Java
A - API-, .
, (, ). , (, ).
?
" " " " ( , , , ).
/. , .
Builder - Builder?
- ?
- . , .
API, , API .
, , 2 " Java".
Builder. , , . GoF :
. . . , . , , .. . , ; Builder. ConcreteBuilder . ; .. , Builder -. , . Builder , . , , .
ProgramNodeBuilder Smalltalk-80. Parser, ProgramNodeBuilder. Parser ProgramNodeBuilder , . , , , .
ProgramNodeBuilder
Parser
stackoverflow , : -)
, ( , : ) . ( ), , . , , , . , , .
, Builder Fluent Interface . .
I wrote a small Builder example with the Fluent Interface, hope this helps.
http://jpereira.eu/2011/10/12/fluent-interfaces-while-trying-to-make-sense-of-prototype-pattern/
Source: https://habr.com/ru/post/1530117/More articles:Should I define a default constructor? - c ++Django: Do ββI have to convert a signed datetime instance to UTC before sending to the model? - pythonPerl command line autosplit vs // - perlΠΠ½ΡΠ΅ΠΊΡΠΈΠΎΠ½Π½ΡΠ΅ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ Π΄Π»Ρ ΠΊΠΎΠ½ΡΠ΅Π½ΡΡΠ°ΡΠΎΡΠΎΠ² SignalR Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ΠΌ autofac in Π² ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ MVC 5 - dependency-injectionCreate an anonymous inner class and call its methods - javaDoes imagestring create blurry text? - phpdo the parameter attributes change the powershell script file somehow? - powershellΠΠ΅ΠΎΠΆΠΈΠ΄Π°Π½Π½ΡΠΉ ΡΠ°Π·ΡΡΠ² Π² ΠΏΡΠ°Π²ΠΎΠΌ Π²Π΅ΡΡ Π½Π΅ΠΌ ΠΈ Π½ΠΈΠΆΠ½Π΅ΠΌ ΠΊΠΎΠ»ΠΎΠ½ΡΠΈΡΡΠ»Π°Ρ , ΠΊΠΎΠ³Π΄Π° ΠΎΠ±Π° ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Ρ Ρ ΡΠΈΡΠΈΠ½ΠΎΠΉ: 100%? - htmlNeo4j Cypher: How do you unpack nodes out of the way to provide further matching? - neo4jPHP ΡΠΎΠ·Π΄Π°Π» ZIP ΡΠ°ΠΉΠ», Π½Π΅ ΡΠ°Π±ΠΎΡΠ°ΡΡΠΈΠΉ Ρ ΠΏΡΠΎΠ²ΠΎΠ΄Π½ΠΈΠΊΠΎΠΌ Windows - phpAll Articles