An introduction to several objects in Java (PO, DO, DTO, DAO, POJO)
PO PO is apersistant object—a persistent object. The concept that appears during O/R mapping ,If there is no O/R mapping,this concept does not exist. Usually corresponds to the data model (database), and itself also has some business logic processing. It can be thought of as a Java object that maps to a table in the database. The simplest PO is a collection corresponding to a record in a certain table in the database – multiple records can use PO. The PO should not contain any operations on the database. DO DO is Domain Object—Domain Object is a tangible object abstracted from the real world or intangible business entity. Generally corresponds to the table structure in the data. TO TO is Transfer Object—data transfer object with different ties (relationships) in the application Objects transferred between DTO DTO is the concept of Data Transfer Object—Data Transfer Object The design pattern derived from J2EE’s original purpose is to provide coarse-grained data entities for EJB distributed applications to reduce the number of distributed calls, thereby improving the performance and reducing the cost of distributed calls. Network load “but here” I generally refer to the data transfer objects between the presentation layer and the service…
Detailed explanation of VO, BO, PO, DO, DTO in Java
Overview Object type position diagram Let’s look at the picture first After reading the picture, most people will probably have an intuitive feeling. Face this picture&# xff0c;Let us start with the DTO that connects the previous and the next Object type description DTO(Data Transfer Object)Data transfer object This transfer usually refers to the before and after Transmission between terminals DTO is a relatively special object ,It exists in two forms: In the backend,It exists in the form of java object&# xff0c; That is, what is defined in the controller. Usually, you don’t need to worry about how to convert json into java objects at the back end. This is done by some mature frameworks for you. ;For example, spring framework At the front end, its existence form is usually an object in js. It can also be simply understood as json, which is the data body requested through ajax. This is why he is drawn across two layers You may encounter a problem here – now that microservices are prevalent – the transfer object called between services can Is it called DTO? My understanding is that it depends on the situation An implicit meaning of DTO itself is to be…
PHP’s simple route analysis can set the suffix at will (html, do, shtml, aspx, etc.)
[php] if(isset($_SERVER['PATH_INFO'])){ $str=substr($_SERVER['PATH_INFO'],0,strpos($_SERVER['PATH_INFO'],'.')); //Get path information (pathinfo) $pathinfo=explode('/',trim($str,'/')); //Get $_GET['m'] $_GET['m']=(!emptyempty($pathinfo[0])?$pathinfo[0]:'index'); //Remove the beginning of the array unit Array_shift($pathinfo); //Get $_GET['a] $_GET['a']=(!emptyempty($pathinfo[0])?$pathinfo[0]:'index'); //Remove the beginning of the array unit Array_shift($pathinfo); $num=count($pathinfo); for ($i=0;$i<$num;$i+=2){ $_GET[$pathinfo[$i]]=$pathinfo[$i+1]; } }else{ $_GET['m']=(!emptyempty($_GET['m'])?$_GET['m']:'index&# 39;); $_GET['a']=(!emptyempty($_GET['a'])?$_GET['a']:'index&# 39;); If($_SERVER[“QUERY_STRING”]){ $m=$_GET['m']; unset($_GET['m']); //Remove m from the array $a=$_GET['a']; unset($_GET['a']); //Remove a from the array $query=http_build_query($_GET); // Form new URL parameters //Combine a new URL $url=$_SERVER['SCRIPT_NAME'].”/{$m}/{$a}/”.str_replace(array(“&”,”=”),”/”,$query) .”.html”; //The point is here header(“Location:”.$url); } } if(isset($_SERVER['PATH_INFO'])){ $str=substr($_SERVER['PATH_INFO'],0,strpos($_SERVER['PATH_INFO'],'.')); //Get path information (pathinfo) $pathinfo=explode('/',trim($str,'/')); //Get $_GET['m'] $_GET['m']=(!empty($pathinfo[0])?$pathinfo[0]:'index'); //Remove the beginning of the array unit array_shift($pathinfo); //Get $_GET['a] $_GET['a']=(!empty($pathinfo[0])?$pathinfo[0]:'index'); //Remove the beginning of the array unit array_shift($pathinfo); $num=count($pathinfo); for ($i=0;$i<$num;$i+=2){ $_GET[$pathinfo[$i]]=$pathinfo[$i+1]; } }else{ $_GET['m']=(!empty($_GET['m'])?$_GET['m']:'index&# 39;); $_GET['a']=(!empty($_GET['a'])?$_GET['a']:'index&# 39;); if($_SERVER[“QUERY_STRING”]){ $m=$_GET['m']; Unset($_GET['m']); //Remove m from the array $a=$_GET['a']; Unset($_GET['a']); //Remove a from the array $query=http_build_query($_GET); //Create new URL parameters //Combine new URL $url=$_SERVER['SCRIPT_NAME'].”/{$m}/{$a}/”.str_replace(array(“&”,”=”),”/”,$query) .”.html”; //The point is here header(“Location:”.$url); } }
Java data object use: PO, DO, TO, DTO, VO, BO, DAO, POJO concept explanation and use
class=”markdown_views prism-atom-one-dark”> PO: Persistent Object Persistent Object The display state of the records in the database table in the java object. The most vivid understanding is that a PO is a record in the database. A record can be treated as an object, and it can also be easily converted to other objects. If there is a piece of data in the database, a simple class is now given an instance of this data, then the existing state of this simple class is PO. (generally/temporarily not used) DO:Domain Object Domain Object Used to receive the entity corresponding to the database, it is an abstract data state, between the database and business logic. Generally, it is used when the Service accesses the database to receive data. Generally placed under the entity/domain package. (Common) TO:Transfer Object Data Transfer Object An object that is transferred between different relationships in the application. (generally/temporarily not used) DTO: Data Tranfer Object Data Transfer Object This concept comes from the J2EE design pattern, which is a method of transferring data between design patterns software application system. The data transferred by the data is generally the data retrieved by the data access object from the database. Generally refers…