DTO cov ntaub ntawv yog dab tsi?
DTO cov ntaub ntawv yog dab tsi?

Video: DTO cov ntaub ntawv yog dab tsi?

Video: DTO cov ntaub ntawv yog dab tsi?
Video: pua yog tim tub aib pog ntawv by paj vuam thoj sonie thoj zoo siab yaj nkauj tawm tshiab 2022 2024, Kaum ib hlis
Anonim

DTO (Data Transfer objects) yog lub thawv cov ntaub ntawv rau kev txav cov ntaub ntawv ntawm cov khaubncaws sab nraud povtseg. Lawv kuj raug hu ua hloov khoom siv. DTO tsuas yog siv los hla cov ntaub ntawv thiab tsis muaj kev lag luam logic. Lawv tsuas muaj qhov yooj yim setters thiab getters. Piv txwv li, hauv qab no yog chav Entity lossis chav ua lag luam.

Cov lus nug tseem yog, kev siv DTO yog dab tsi?

Cov ntaub ntawv hloov khoom siv ( DTO ), yav tas los hu ua cov khoom muaj nqis lossis VO, yog tus qauv tsim siv los hloov cov ntaub ntawv ntawm software daim ntawv thov subsystems. DTOs feem ntau yog siv ua ke nrog cov ntaub ntawv nkag mus rau cov khoom siv los khaws cov ntaub ntawv los ntawm database.

Ib tug kuj yuav nug, DTO sawv cev rau dab tsi? cov ntaub ntawv hloov khoom siv

Kuj kom paub, DTO qauv yog dab tsi?

Ib Qhov Kev Hloov Cov Ntaub Ntawv ( DTO ) yog ib qho khoom siv los nqa cov ntaub ntawv, piv txwv li ntawm tus neeg siv khoom thiab lub server lossis nruab nrab ntawm UI thiab cov txheej txheem sau npe. Qee zaum a DTO tuaj yeem pom raws li tus kab mob anemic qauv . DTOs feem ntau yog siv tawm ntawm lub hexagon, nyob rau hauv tus me nyuam mechanism.

Dab tsi yog qhov txawv ntawm DTO thiab qauv?

POJO programming qauv ua rau nws muaj peev xwm siv tib yam khoom raws li koj lub npe, DTO thiab qauv cov khoom - qhov tseem ceeb, koj yuav tsis raug coj los siv cov kev sib txuas ntxiv uas tsuas yog siv rau ib txheej tab sis tsis siv rau lwm tus. A DTO = yog ib yam khoom uas nqa cov ntaub ntawv nruab nrab txheej txheem.

Pom zoo: