Video: Dao chav kawm nyob rau lub caij nplooj ntoos hlav yog dab tsi?
2024 Tus sau: Lynn Donovan | [email protected]. Kawg hloov kho: 2023-12-15 23:47
Nws yog tus qauv tsim nyob rau hauv uas cov ntaub ntawv nkag khoom ( DAO ) yog ib yam khoom uas muab qhov kev paub daws teeb meem rau qee yam ntawm cov ntaub ntawv lossis lwm yam kev ua haujlwm tsis tu ncua. Caij nplooj ntoos hlav Cov ntaub ntawv nkag mus rau hauv lub moj khaum yog muab los ua ke nrog cov txheej txheem sib txawv xws li JDBC, Hibernate, JPA, iBatis thiab lwm yam.
Ua li no, dab tsi yog chav dao?
Data Access Object Pattern los yog DAO qauv yog siv los cais cov ntaub ntawv qib qis nkag mus rau API lossis kev ua haujlwm los ntawm cov kev pabcuam kev lag luam siab. Qhov no chav kawm yog lub luag haujlwm kom tau txais cov ntaub ntawv los ntawm cov ntaub ntawv uas tuaj yeem yog database / xml lossis lwm yam kev khaws cia.
Kuj Paub, Dab tsi yog Dao chav kawm hauv Java? Nws yog ib yam khoom/interface, uas yog siv mus saib tau cov ntaub ntawv los ntawm database ntawm cov ntaub ntawv cia. Vim li cas peb siv DAO : nws abstracts qhov retrieval ntawm cov ntaub ntawv los ntawm ib cov ntaub ntawv kev pab xws li ib tug database. Lub tswv yim yog "sib cais cov ntaub ntawv kev pabcuam tus neeg siv khoom sib txuas los ntawm nws cov ntaub ntawv nkag mus."
Xav txog qhov no, Dao chav kawm yog dab tsi hauv lub caij nplooj ntoos hlav khau?
DAO stands rau data access object. Feem ntau, cov DAO hoob yog lub luag haujlwm rau ob lub tswv yim. Encapsulating cov ntsiab lus ntawm cov txheej txheem persistence thiab muab CRUD interface rau ib qho chaw.
DAO thiab DTO yog dab tsi thaum caij nplooj ntoos hlav?
DAO yog ib chav kawm uas feem ntau muaj cov haujlwm CRUD xws li txuag, hloov tshiab, rho tawm. DTO tsuas yog ib yam khoom uas tuav cov ntaub ntawv. Nws yog JavaBean nrog piv txwv hloov pauv thiab setter thiab getters. DTO yuav dhau los ua tus nqi kwv yees rau DAO txheej thiab DAO txheej yuav siv cov khoom no mus txuas ntxiv cov ntaub ntawv siv nws txoj kev ua haujlwm CRUD.
Pom zoo:
@ResponseBody annotation nyob rau lub caij nplooj ntoos hlav yog dab tsi?
Cov lus siv: Java, JSON
Cron kev qhia yog dab tsi nyob rau lub caij nplooj ntoos hlav?
Ib qho Cron qhia muaj rau qhov ua ntu zus - thib ob, feeb, teev, hnub ntawm lub hli, hli, hnub (s) ntawm lub lim tiam.thiab tau tshaj tawm raws li hauv qab no @Scheduled(cron = '* * * * **')
Log4j nyob rau lub caij nplooj ntoos hlav yog dab tsi?
Log4j yog qhov nrov thiab siv dav hauv kev nkag mus rau Java txoj kev loj hlob. Nws yooj yim zoo nkauj los teeb thiab siv Log4j mechanism hauv Spring Mvc daim ntawv thov. Nyob rau hauv no nyeem, kuv yuav qhia koj yuav ua li cas rau siv lub loging functionality nrog lub caij nplooj ntoos hlav Mvc moj khaum
Kev siv @value annotation nyob rau lub caij nplooj ntoos hlav yog dab tsi?
Spring @PropertySource annotations yog tsuas yog siv los nyeem los ntawm cov ntaub ntawv khoom siv Spring's Environment interface. Cov lus piav qhia no yog nyob rau hauv kev xyaum, muab tso rau ntawm @Configuration chav kawm. Caij nplooj ntoos hlav @Value annotation tuaj yeem siv los qhia cov lus qhia ntawm daim teb lossis txoj hauv kev. Cov ntaub ntawv siv feem ntau yog qhia cov cuab yeej los ntawm a
Lub ntsiab lus configuration nyob rau lub caij nplooj ntoos hlav yog dab tsi?
Lub Caij Nplooj Ntoos Zeeg yog dab tsi? Caij nplooj ntoos hlav ntsiab lus tseem hu ua Spring IoC ntim, uas yog lub luag hauj lwm rau instantiating, configuring, thiab assembling taum los ntawm kev nyeem configuration metadata los ntawm XML, Java annotations, thiab / los yog Java code nyob rau hauv cov ntaub ntawv configuration