DTO(Data Transfer Object) ? DAO(Data Access Object)? ????? ??, ?? Java ?? ???????? ?? ???? ?? ??? ?????. ??? ??? ?? ??? ??????.
DTO(??? ?? ??):
??: DTO? ??????? ??? ?? ???? ?? ???? ????? ??? ??? ?????.
?? ??: ??? ?? ?? ?????(?? ???? ?????) ???? ???? ??? ? ?? ???? ??? ?? ???? ???? ????? ? ?? ?????.
??:
???? ???? ??? ???? ????.
getter? setter? ????? ???? ??? ???? ????.
???? ???? API ??? ?? ???? ? ????.
DTO? ?:
?? ??? UserDTO {
?? ??? ??? ??;
?? ??? ???;
// Constructor public UserDTO(String username, String email) { this.username = username; this.email = email; } // Getters and setters public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; }
}
DAO(??? ??? ??):
??: DAO? ???????? ????? ?????. ??? ??? ????? ??? ??? ?? CRUD(??, ??, ????, ??) ??? ???? ??? ?????.
?? ??: ?? ?? ??? ???? ?????? ??? ???? ??? ?????.
??:
SQL ?? ?? ORM(?: Hibernate, JPA) ??? ??????.
?????? ???? ?????.
save(), findById(), delete() ?? ?? ??? ??? ???? ?????.
DAO? ?:
java.sql.Connection ????;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
?? ??? UserDAO {
?? ?? ??;
public UserDAO(Connection connection) { this.connection = connection; } public UserDTO getUserById(int id) throws Exception { String query = "SELECT username, email FROM users WHERE id = ?"; PreparedStatement statement = connection.prepareStatement(query); statement.setInt(1, id); ResultSet resultSet = statement.executeQuery(); if (resultSet.next()) { String username = resultSet.getString("username"); String email = resultSet.getString("email"); return new UserDTO(username, email); } return null; } public void saveUser(UserDTO user) throws Exception { String query = "INSERT INTO users (username, email) VALUES (?, ?)"; PreparedStatement statement = connection.prepareStatement(query); statement.setString(1, user.getUsername()); statement.setString(2, user.getEmail()); statement.executeUpdate(); }
}
??:
???????? DAO? ???????? ???? ???? DTO ??? ???? ?? ?? ??(?: ??? ?? ????)?? ????.
?? ??:
???? ??: ??? ??? ?????.
??? ??: DAO? ?? ???? ???? ????? ?????.
DAO ???: ???? ???? DTO? ???? ?????.
?? ?:
//????
?? UserDTO getUserDetails(int id) {
return userService.getUserById(id);
}
//???
?? UserDTO getUserById(int id) {
return userDAO.getUserById(id);
}
??:
DTO: ??? ??? ????? ?? ????? UI ?? ?? API ??? ?????.
DAO: ?????? ??? ??? ?? ????? ??? ? ???? ???? ????.
? ??? ???? ??? ???? ?????!
? ??? ????? ??? DTO ? DAO? ?? ?????. ??? ??? 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)

??? ??











?? ?? ?? ??? ??? ?? ??? ??, ? ? ?? ? ??? ?????. 1. ??? ?? ???? ?? ???? ???-????, ? ??? ??? ??? ? ????, Hashmap? ???-??? ?? ??? ??? ???? ????. 2. NULL ? ?? ???? HashMap? ??? NULL ?? ?? ? ?? ???? ?? HashTable? NULL ?? ?? ???? ??? NullPointerException? ?????. 3. ????? ??? ????? ?? ??? ?? ?? ? ????? HashTable? ? ??? ?? ?? ??? ????. ?? ConcurrenTashMap? ???? ?? ????.

Java? ?? ??? ??? ?? ??? ??? ?? ??? ??? ?? ??? ?? ?? ??? ???? ??? ?? ???? ?????. 1. ??? ???? ??? ?? ?? ? ???? ?? ??? ???? ?? ?? ??? ? ????. 2. ???? ?? ??? ???? ??? ?? ???? ?? ?? ??? ???????. 3. ?? ???? ?? ?? ?? ? ???? ???? ?? NULL ?? ??? ? ????. 4. ?? ???? ??? ?? ?? ? ??? ?????? ?? ??? ??? ?? ?? ??? ????? ??? ??? ??? ??????? ?? ???? ??????.

staticmethodsininterfaceswereIntRectionSelffacesswithinteffaceswithinteffaceswithintintinjava8toallowutilityFunctionswithinterfaceitswithinteffaceswithinterfaceffaces

JIT ????? ??? ???, ??? ?? ? ???, ?? ?? ? ???? ? ? ?? ?? ??? ? ?? ??? ?? ??? ??????. 1. ??? ???? ?? ?? ??? ??? ?? ?? ???? ??? ?? ?????. 2. ??? ?? ? ??? ?? ?? ? ??? ???? ?? ?? ???; 3. ?? ??? ??? ?? ??? ???? ???? ???? ? ?? ?? ??? ?????. 4. ?? ??? ?? ??? ??? ???? ???? ?? ? ??? ???? ?? ??? ?????.

???? ??? ??? Java?? ??? ?? ???? ??? ?? ? ? ??? ??? ???? ? ?????. ?? ???? ??? ??, ??? ?? ??? ?? ?? ??? ??? ????? ???? ????? ?????. ?? ??? ??? ??, ????? ? ??? ????, ?? ??? ??? ?????? ? ?? ? ?? ?????.

injava, thefinalkeywordpreventsavariable'svalue'svalueffrombeingchangedafterassignment, butitsbehaviordiffersforprimitivesandobjectreences.forprimitivevariables, asinfinalintmax_speed = 100; wherereassoncesanerror.forobjectref

??? ??? ?? ?? ??? ????? ? ???? ????? ???? ?? ???? ?? ???? ?????. ?? ??? ??? ????. ?? ?? ?? ??? ???? ???? ?? ?? ??? ??? ?? ?? ??? ??? ?????. ?? ??? ??? ????. ?? ??? ?? ??? ?? ?? ??? ?? ?? ??? ???? NewClass ()? ??? ?? ???? ????. ?? ??? ?? ??? ???? ?? ??? ?? ? ? ??? ?? ?? ??? ????? ????? ?????. ?? ??, ?? ?????? ?????, ??? ? ?? ????? ??? ?? ?????. ???? ?? ?? ??? ???? ?? ???? ?? ? ??? ???? ?? ??? ?? ?????? ?????. ???? ???? ??? ??, ?? ?? ? ?? ??? ????, ?? ?? ???? ?????.

??? ? ?? ??? ???? : ????? ?? ?. 1. int? ???? ???? ?? ?? ?? ? ??? ???? ?????. 2. ?? ? ???? (int) myDouble ??? ?? ?? ??? ?????. ?? ??? ??? ?? ??? ?? ??, ?? ?? ?? ???? ?? ??? ?? ???? ?? ?????. ???? ? ??? ??? ????. ?? ??? ??? ??? ??? ??? ?? ??? ??? ? ??? ?? ???? ??? ??? ??? ??? ? ??? ?? ??? ?? ??? ?? ?? ? ? ????. ?? ?? ??? ?? ??? ??? ??? ??? ? ??????.
