tauira hoahoa pūmanawa – GOF

whakarōpū o 23 tauira hoahoa (tauira hoahoa) pūmanawa, tuarua “GoF” (Gang o Whā).

i roto i te mahi

Ko te whakaaro i konei, ko te ki te whakaatu he aha ka pehea ki te whakarōpū tauira hoahoa, rite anake tenei kua taea e tino whai hua ki te whakaoti nui o nga take ngawari tūmatanui, kite anake:

Na roto i te āhua o te piha haapiiraa te huri, hiahia te kaiwhakawhanake kotahi, neke atu rānei ngā akomanga o te gui ki te whakawhiti. Heoi, e kore e te kaiwhakawhanake kitea ngā ki te waihanga i tētahi hononga kaha i waenganui i enei akomanga. He aha te tauira o te hoahoa whanonga te pai ngā waka ki te whakatutuki i tēnei āhuatanga?
( ) Composite
( ) whāurutau
( ) Observer
( ) Factory waitara
( ) decorator

Pea te mea te pātai ki te rapu utu atu tohungatanga, engari mōhio ki te matau anake koe te whakarōpūtanga, i taea kua patua e ahau i te reira ki te iteraa katoa. Ko te taipitopito i roto i te wāhanga e ui “hoahoa tauira whanonga”, a reira, ko te kotahi anake kē e hāngai, te tauira Observer. whakatau take, ngāwari!

i roto i te ariā

Ko te manawataki ko tenei:



Kia mahara e te taunoa whāurutau Kei te anake tono te reira ki ngā akomanga e rua rite ahanoa hoki, i te mea he aha whakaaturanga te tepu 24 whakawākanga (a kihai 23).

Decoreba

e kore ai whakarakai e te ara pai ki te ako, engari ki kia nui ki te ako, Ka taea e tenei matamata whakaora wā koe “H”. He ara ngāwari ki te whakapaipai i enei paerewa ko roto mnemonics. Kāore he Blog Rogerio Araújo He he ara tino auaha, whakapaipai koe tika rua rerenga a taea hanga kua he whakatauranga pai, na:

paerewa FAKATUPÚ (5)

he wheketere Abstract hanga he tauira anake!

translation: he wheketere (Tikanga Factory) Abstract (Factory waitara) hanga (Kaihanga) he tauira taketake (tauira) anake (Singleton).

paerewa hanganga (7)

He Hong taunga ko reira compote o whakapaipai na paruru mo te taimaha rere ko "Aproxymar"!

translation: Ko te piriti (Bridge) taunga (whāurutau) Kei roto (Composite) whakapaipai (decorator) i runga i te paruru (paruru,) ki te mā (mā) ki te "aproxymar" (takawaenga).

tauira whanonga (11)

Ako nei nga paerewa hanga e os hanganga, te toenga he paerewa whanonga.

ariā

(haere ki tua atu)

1

whāurutau

(hanganga)

Tahuri i te atanga o te piha haapiiraa i roto i tetahi atu atanga, tūmanakohia e kiritaki, tuku akomanga ki atanga hotokore ki te mahi tahi, aha, te kore, e te mea e taea.

2

paruru,

(hanganga)

Whakarato i te atanga kotahi ki te taumata teitei mō te huinga o atanga i roto i te pūnaha. i roto i te mau parau te tahi atu, whakarato te reira i te atanga ki ngā āhuatanga o te API (akomanga kohinga) ohie me ara ngāwari ki te whakamahi i.

3

Composite

(hanganga)

Tukua te maimoatanga o ngā takitahi me tito o enei taonga mangai.

4

Bridge

(hanganga)

whakaäetia te (motuhake) he oti'a i tona whakatinanatanga kia e taea e rua rerekē takitahi.

5

Singleton

(hanga)

Me whakarite e te piha haapiiraa e kotahi anake tauira, me te whakarato i te wāhi uru ao ki reira.

6

Observer

(whanonga)

Kia anga te whakawhirinaki i runga i tetahi-ki-he tokomaha hononga i waenganui i ngā kia e ka taui ahanoa kotahi āhua, E whakamōhiotia ratou pararau ka whakahoutia aunoa.

7

Arai

(whanonga)

Tautuhia tētahi ahanoa e tauakī i pehea te huinga o ngā taunekeneke.

8

takawaenga

(hanganga)

Whakarato i te whakakapinga ranei ira i roto i nei hei ahanoa taea te whakahaere i te uru ki te tahi atu. Kei te mohiotia ano e reira rite a Maata.

9

Mekameka o te Fatongia

(whanonga)

Titoa ahanoa hūkere, i roto i reira, horo'ai te tono noa ki te ahanoa mahi. ārai tenei te hononga i waenganui i te kaituku o te tono, me tona kaiwhiwhi, hoatu wāhi mō te ahanoa neke atu i te kotahi te hapai i te tono.

10

(hanganga)

Whakamahia tiritiri ki te tautoko i tōtika whakawhiti nui o ngā matatini (pai-baked).

11

Kaihanga

(hanga)

Wehe i te hanga o te ahanoa matatini i tona māngai kia e taea te tukanga hanga taua hanga ngā rerekē.

12

Tikanga Factory

(hanga)

Tautuhia tētahi atanga mō te hanga i tētahi ahanoa engari kia subclasses whakatau e te piha haapiiraa ki instantiate. Ka āhei te reira Hikitia instantiation ki subclasses.

13

Factory waitara

(hanga)

Whakarato atanga mō te hanga hapu o ngā hāngai ana ti'aturi ranei kahore tauwhāiti ratou akomanga raima.

14

tauira

(hanga)

Tauwhāiti momo ki te hanga i tētahi tauira whakamahi i te tauira me te waihanga ngā hōu mā te tārua i tēnei tauira.

15

ngahunga

(whanonga)

Rokiroki i te āhua ā-o te ahanoa kua kia e taea faaho'ihia mai i muri i te reira ratou mana (wete).

16

Tikanga tātauira

(whanonga)

Tautuhia te kōhiwi o te hātepe i roto i te mahi, mahue etahi kaupae e ki tonu e subclasses. Āhei tautuhi ona subclasses etahi kaupae o te hātepe i waho te huri tona hanganga.

17

State

(whanonga)

Tukua he ahanoa ki te huri i tona whanonga me ona huringa āhua ā-.

18

Rautaki

(whanonga)

Tautuhia te whānau o hātepe, āhuatanga ia ka hanga whakawhiti ratou.

19

Whakahaua

(whanonga)

Encapsulating rite tono ahanoa, hoki tono rerekē kiritaki parametrizarem.

20

Interpreter

(whanonga)

Homai he reo, tautuhi i te kanohi mo tona wetereo he kaiwhakamaori i roto i.

21

decorator

(hanganga)

Āpiti kawenga atu ki te ahanoa hihiri.

22

Iterator

(whanonga)

Whakarato i te huarahi ki te uru āhuatanga o te raupapa ahanoa whakahiato kahore tuu ia tona kanohi ā-.

23

Visitor

(whanonga)

Tohu i te mahi ki te kia whakamana i runga i nga mea timatanga o te hanganga ahanoa. āhei te reira ki a koe te tautuhi i te mahi hou i waho te huri i te akomanga o te āhuatanga i roto i nei mahi reira.

 

pūtake

Rogerio Araújo – te ora, IT me Contests

maha Tapeke o täia: 4782

Waiho i te Reply

Ka kore e whakaputaina tō wāhitau īmēra. Kua tohua ngā āpure e hiahiatia ana ki *