SOLID? ?? ?? ?????(OOP)?? ??? ?? ???? ???? ????? ?? ??? ?? ?? ?????. ?? 5?? ?? ???? ?????.
- S ?? ?? ???—?SRP
- O ? ?? ???—?OCP
- L iskov? ?? ???—?LSP
- I ????? ?? ???—?ISP
- D ??? ?? ???—?DIP
??? ??? ??? C. ??(? ?????? ?)? 2000?? ??? ??? ?? ????? ?? ?????? ?? ???????. SOLID ??? ??? ???? ? ?? ????, ????, ??? ? ?? ??? ???? ?? ???? ?? ??? ??? ????? ???? ?? ? ????.
?? ?? ??(SRP)
?? ?? ??? OOP? SOLID? ? ???? ?? ???? ?????. ???? ? ? ??? ? ??? “??? ???? ??? ???? ??? ??? ??”? ?????.
invoice?? ???? ??? ??? ?????. ???? generateInvoice() ? saveToFiles() ??? 2?? ???? ????.
public class Invoice { private Long InvoiceNo; public void generateInvoice() { // code to generate Invoice. } public void saveToFiles() { // code to save invoice as a file. } }
Invoice ????? ? ?? ??? ???? ?? ?? ??? ????. ? ?? ?? ??? ??? ??? ?? ???? ???? ????.
public class Invoice { private Long InvoiceNo; public void generateInvoice() { // code to generate Invoice. } } public class FileManager { public void saveToFiles(Invoice invoice) { // code to save invoice as a file. } }
??? ?? ??? ?? 2?? ???? ??? ? ? ????.
- ???? ??
- ??? ??
SRP? ?? ?? ??
- ??? ?? ??: ??? ?? ???? ???? ?????? ?? ????? ???? ?????.
- ????? ?? : ???? ?? ??? ??? ?? ???? ??? ???? ???? ?? ??? ?? ????? ? ????.
- ???? ??: ?? ??? ?? ???? ??????? ?? ???? ??? ?? ??????? ???? ???? ? ????.
- ? ?? ??? : ?? ??? ?? ???? ????? ? ?? ? ?????? ????? ?????? ? ????.
??-?? ??(OCP)
??-?? ??? SOLID? ? ?? ?? ?????. ? ??? 1997? Bertrand Meyer? ?? ???????. ? ??? ??? ?? ????? "????? ????(???, ?? ? ??)? ??? ?? ??? ??? ??? ???? ?? ??? ???."
?? ??
Shape?? ???? ??? ??? ?????. ? ???? ???? ??? ??? ??? ? ????.
public class Invoice { private Long InvoiceNo; public void generateInvoice() { // code to generate Invoice. } public void saveToFiles() { // code to save invoice as a file. } }
? ???? ? ??? ????? ?? Shape ???? ???? ??? ?? ?? ???? ???? ????.
??? ??-?? ??? ? ????? ???? ??? ???? ?? ?????.
public class Invoice { private Long InvoiceNo; public void generateInvoice() { // code to generate Invoice. } } public class FileManager { public void saveToFiles(Invoice invoice) { // code to save invoice as a file. } }
OCP? ???? ?? ??? ???? ??? ??? ?? ?? ??? ??? ? ????.
??: ?????? ???? ?? OCP? ???? ??? ??? ????.
OCP? ?? ?? ??
- ?? ?? ?? : ?? ??? ???? ????? ??? ??? ????? ?? ??? ??? ??? ??????.
- ????? ?? : OCP? ??? ??? ?? ?????? ???? ??? ??? ??? ??? ? ???? ?? ?? ? ??? ? ????.
- ??? ???: ???? ???? ???? ?? ???? ?? ??? ???? ??? ???? ?? ??? ? ?? ??? ? ????.
Liskov? ?? ??(LSP)
Liskov? ?? ??? OOP? ? ?? ??? ?????. ?? 1987? ??? ???? ?? ???? ???? Barbara Liskov? ?? ???????.
? ??? "?????? ??? ????? ???? ???? ?? ?? ???? ??? ?? ???? ??"? ????.
?? ?? Circle? Rectangle? Shape? ?? ??? ?? Shape ??? ?? ?? Circle ?? Rectangle ??? ?? ? ????.
public class Shape { private String shapeType; private double radius; private double length; private double width; public Shape(String shapeType, double radius, double length, double width) { this.shapeType = shapeType; this.radius = radius; this.length = length; this.width = width; } public double area() { if (shapeType.equals("circle")) { return Math.PI * (radius * radius); } else if (shapeType.equals("rectangle")) { return length * width; } else { throw new IllegalArgumentException("Unknown shape type"); } } } // Usage public class Main { public static void main(String[] args) { Shape circle = new Shape("circle", 5, 0, 0); Shape rectangle = new Shape("rectangle", 0, 4, 6); System.out.println(circle.area()); System.out.println(rectangle.area()); } }
? ??? ? ? ??? Liskov ?? ??? ????? ?? ????? ????? ?? ??? ????? ???? ??? ? ??? ?? ?????.
LSP? ?? ?? ??
- ??? ?? ????: ?? ??? ?? ???? ??? ? ??? ???? ?? ??? ???? ??? ?? ?? ???? ??? ? ?? ?? ???? ?????.
- ??? ?? ?? : LSP? ??? ??? ?????? ????? ??? ? ??? ??? ??? ???? ??? ?? ??? ? ????.
- ? ?? ??? ???: LSP? ???? ???? ?? ?? ??? ?? ?? ???? ? ?? ??? ? ????. ???? ?? ??? ?? ??? ? ?? ?? ?? ??? ?? ???? ?? ?????.
????? ?? ??(ISP)
????? ?? ??? ??? C. ??? ??? 5?? SOLID ?? ? ?????. "?????? ???? ?? ?????? ????? ????? ? ???."?? ???? ????.
?, ??? ?? ?????? ???? ??? ?? ??? ?????? ???? ?? ? ????.
?? ??? ?? ?????? ???? ?????.
public class Invoice { private Long InvoiceNo; public void generateInvoice() { // code to generate Invoice. } public void saveToFiles() { // code to save invoice as a file. } }
MultifunctionPrinter? ?? ?? ?????? ???? ???? ???? ???? ???, ?? ?? ???? ?????. ? ????? ????? ?? ??? ??? ? ?? ??? ???????.
?????
public class Invoice { private Long InvoiceNo; public void generateInvoice() { // code to generate Invoice. } } public class FileManager { public void saveToFiles(Invoice invoice) { // code to save invoice as a file. } }
??
public class Shape { private String shapeType; private double radius; private double length; private double width; public Shape(String shapeType, double radius, double length, double width) { this.shapeType = shapeType; this.radius = radius; this.length = length; this.width = width; } public double area() { if (shapeType.equals("circle")) { return Math.PI * (radius * radius); } else if (shapeType.equals("rectangle")) { return length * width; } else { throw new IllegalArgumentException("Unknown shape type"); } } } // Usage public class Main { public static void main(String[] args) { Shape circle = new Shape("circle", 5, 0, 0); Shape rectangle = new Shape("rectangle", 0, 4, 6); System.out.println(circle.area()); System.out.println(rectangle.area()); } }
ISP? ???? ???, ???, ??? ?? ? ?? ??? ??????? ??????. ?? ?? ? ???(?: BasicPrinter, AdvancedPrinter ?? FaxMachine)? ?? ??? ???? ???? ???? ???? ???? ?? ? ????.
ISP? ?? ?? ??
- ??? ? ??? ??? ?? : ??? ?????? ? ?? ???? ?????? ?????? ??? ?? ????? ??? ??????. ???? ??? ??? ?????? ??? ? ???? ???? ???? ??? ???? ?? ???? ??? ? ?? ???? ? ????.
- ?? ??? ??: ???? ??? ??? ??????? ???? ??? ? ????? ???? ?????. ???? ???? ???? ???? ??? ??? ?? ?????. ?? ?? ?? ??? ??? ????.
- ????? ?? : ? ?? ??? ?????? ?? ?? ??? ? ?????. ??? ?????? ???? ???? ?? ??? ??? ?? ???? ?? ??? ????? ?? ??? ??? ??? ?????.
- ? ?? ??? ???: ? ?? ??? ?????? ?? ?? ?? ??? ?? ?? ???? ? ?? ??? ? ????. ?? ?? ???? ???? ??? ?? ?? ?? ???? ???? ??? ? ?? ?????.
- ??? ?? : ISP? ?????? ???? ?? ????? ???? ??? ? ?????. ?? ???? ??? ?? ?? ??? ?????? ???? ?? ?????? ???? ??? ???? ?? ??? ??? ? ????.
??? ?? ??(DIP)
??? ?? ??? SOLID? ?? ?????. ??? C. ??? ??? ????? ???. ?? ???? ??? ??? ?????.
DIP?? ? ?? ??? ???? ????.
- ?? ??? ?? ??? ?????? ? ???.
- ? ? ???? ???? ???.
- ??? ????? ????? ? ???.
- ?? ??? ???? ?? ?????.
??? ??? ???? ?? ?? ???(??? ??)? ?? ???? ?? ????? ?? ?? ???? ????? ???. ?? ???? ???? ??? ??? ??? ? ???? ??? ?? ????? ?? ??? ?????.
???? ??? ??(DIP ??)
public class Invoice { private Long InvoiceNo; public void generateInvoice() { // code to generate Invoice. } public void saveToFiles() { // code to save invoice as a file. } }
?? ??? ? ? ??? Computer ???? Keyboard ???? ????? ?????.
???? ??? ??(DIP ??)
public class Invoice { private Long InvoiceNo; public void generateInvoice() { // code to generate Invoice. } } public class FileManager { public void saveToFiles(Invoice invoice) { // code to save invoice as a file. } }
?? ???? ?? ???? ?? InputDevice ?????? ?????. ??? ?? Computer ???? ???? ??? WirelessKeyboard? ?? ?? ?? ??? ?? ??? ? ????.
DIP? ??? ?? ? ?? ??
- ??? ??: ???? ??? ?? ???? ???? ?? ??? ? ??? ?? ??? ??? ?? ?? ???? ? ??? ?? ??? ? ????.
- ????? ?? : ?? ??? ?? ??? ?? ??? ??? ?? ???? ??? ?? ?? ? ??? ? ?????.
- ??? ??? ??? : ?? ?? ??? ?? ??? ???? ?? ?? ??? ???? ? ???? ??? ??? ???? ?????.
- ???? ??: ?? ?? ??? ???? ?? ?? ??? ??? ?? ?? ??? ???? ???? ? ????.
??
????? SOLID ??: ?? ??, ???, ???, Liskov ??, ????? ?? ? ??? ??? ?? ?? ??????? ???? ?? ?? ???? ?? ??? ??? ???? ?? ?? ??? ?????.
??? ??? ?????? ???? ? ?? ????, ????, ??? ? ?? ???? ?? ? ??? ????? ? ?? ??? ?????? ? ???? ?? ????? ??? ? ????.
??
? ?? ????? ?????! ?? SOLID ??? ?? ???? ????? ???? ? ?? ??? ???? ?????? ????.
???:
- LinkedIn?—?@nsadisha
- GitHub?—?@nsadisha
- ???—?@nsadisha
- Dev.to?—?@nsadisha
— ??? ???
? ??? ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

?? ?? Java? ?? ???? ?? ? ? ? ????? ????, ? ??? ??? ??? ??? ???? ? ????. 1. ?? ?? hashcode () ???? ???? ?? ?? ???? ?? ??? ?? ?? ???? ?????. 2. ?? ??? ??? ?? ?? ???? ??? ??? ? ????. ?? ??? ?? ? ??? ??? ?????. JDK8 ? ?? ? ??? ?? ?? (?? ?? 8) ??? ????? ?? ???? ?? ? ??? ?????. 3. ??? ?? ???? ?? ???? ?? equals () ? hashcode () ???? ?? ???????. 4. ?? ?? ??? ???? ?????. ?? ?? ??? ???? ?? ?? (?? 0.75)? ??? ?? ? ???; 5. ?? ?? ??? ??? ??? Multithreaded?? Concu? ???????.

?? ??? ??? ???? ???? ? ??? ?? ?? ???? ?? ? ????. 1. ??. ofnullable? null ??? ??? ???? ?????. ?? ??, ??? ?? ??? ? Orelse? ???? ???? ? ???? ??? ???? ?????. 2. ?? ?? ?? ???? ?? ?? ???? NPE? ???? ??? ??? ??? ???? ???? ???? ?????. 3. ??? ??? ???? ??? ? ???, ??? ???? ???? ?? ??? ?? ?????. ??? ??? ??? ???? ??? ??? Orelse? ?? ?????. 4. ?? ???? ??? ??? ?? ??? ??? ???? ???? ?? ???? ???? ???? ?? ??? ?? ????? NU? ?? ?????.

java.io.notserializableException? ????? ?? ?? ??? ??? ???? ?? ???? ??? ??? ?????? ???? ?? ? ??? ??? ??? ????? ???? ????. 1. ?? ???? ??? ??????. 2. ???? ?? ??? ?? ???? ??? ??? ?????????. 3. ??? ? ????? ?? ??? ??? ??????. 4. ?? ?? ?? ? ???? ? ??? ??? ??????. 5. ?????? ???? ?? ???? ??????. 6. ? ??? ?? ?? ??? ??? ?? ?? ??? ?? ??? ??? ???? ?? ??? ??????. 7. ??? ??????

Java? ?? ??? ??? ????? ?? ? ???? ???? ???? ???? ???? ????. 1. ???? ?? ?? ??? ?? ???? ???? InputStreamReader ? OutputStreamWriter? ???? ??? ?? ???? ???? ??? ?? ? ?? ??? ??????. 2. ???? ???? ???? ?? ? ? ?? ?? ??????? ??? ??? ?? ??? ???? ?????? ???? ?? ??? ??????. 3. String.getBytes () ? Newstring (byte [])????? ???? ??? ??? ?? ??? ??? ??? ?? ?? Standardcharsets.utf_8? ???? ??????. ???,

Javasocket ?????? ???? ??? ????, ?????? ?? ?? ??? ??? ??? ?? ?????. 1. Java? ??? ?????? ???? ?? ???? ???? ???? ?? ?? ???? ????. 2. ?? ????? ??? ? ?? ?? ?? ??? ??? ?? ?????? ??? ???????. 3. ?????? ?????? ?? ??, ??? ?? ? ?? ? ??? ??? ?????. 4. ?? ???? ?? ??? ??? IP ??? ???? ????, ??? ????? ????, ?? ?????? ???? ?? ?????. ???? ????? ?? ???? ?? ??? ??? ? ????.

Java??? ?? ???? ?? ?? ??? ????? ???? ? ???? ???? ?? ?? ??? ??? ???? ? ?????. 1. ??? ??? ?? ? ????????. ?? () ???? ?? ???? ?? ??? ?????. ??? ?? ??? ?? ???? ?? ????? ???? ?? ????? ???? ?????. 2. ???? ?? ?? ? ?? ???????, ??? ???? ?? ?? ??? ??? ??? ??? Compare () ???? ?? ????, ??? ?? ??? ??? ? ??? ?? ??? ?? ?????. ?? ???? ??? ??? ?? ?? ? ?? ? ? ??? ??? ??? ????? ??? ??? ??? ????.

Java????? ?? ??? ? ?? ???? ??? ????. 1. Entryset? ???? ?? ?? ??? ?????. ?? ???? ????? ?????. 2. ?? ?? ?? ???? ?? ? ?? ?? ?? ?????. 3. ?? ??? ?????? Java8? foreach? ??????. Entryset? ?? ? ? ?? ?? ? ?? ??? ???? ? ??? ?? ?????. ? ??? ?? ?? ?? ?????? ?????. ?? ? ? ??? ?? ?? Keyset () ?? values ()? ????? ?? ?? ?? Map.Get (?)? ?? ?? ?? ? ????. Java 8? foreach ((?, ?)-& gt? ??? ? ????

injava, thestatickeywordmeansamembeLongstotheclassitself, nottoinstances.StaticvariablesAresharedAcrossAllInstances ? OutObjectCreation, ??? ForgloBalTrackingorConstants.StaticMethodsOperateateAteAteClassEvel, canceCcessnon-StaticMbers, statice
