Matsayi na ƙirar software – GOF

Rabawa na 23 tsarin zane (tsarin zane) na software, na biyu “GoF” (Gangar mutane Hudu).

A aikace

Manufar anan shine a nuna menene tsarin zane da yadda ake tsara su, saboda wannan a karan kansa na iya zama mai matukar alfanu don magance mafi yawan al'amuran da suka shafi jama'a, ganin kawai:

Lokacin canza yanayin aji, mai haɓaka yana son a gyara ɗaya ko fiye da zane-zanen hotunan zane-zane. Koyaya, mai haɓaka ba shi da ban sha'awa don ƙirƙirar haɗuwa mai ƙarfi tsakanin waɗannan azuzuwan. Wanne tsarin ƙirar ɗabi'a ya fi dacewa don warware wannan yanayin?
( ) Hadedde
( ) Adafta
( ) Mai Lura
( ) Ma'aikatar Abstract
( ) Mai ado

Wataƙila tambayar ma tana neman buƙatar ilimi mai zurfi, amma lura cewa idan kawai kuna san rarrabuwa, Da tuni na iya buga shi da dukkan tabbaci. Detailarin dalla-dalla yana cikin sashin da ya nema “tsarin ƙirar ɗabi'a”, kuma akwai hanya ɗaya tak da ta dace, tsarin lura. An warware matsalar, a sauƙaƙe!

A ka'ida

Tebur shi ne wannan:



Gane cewa tsarin Adafta shine kadai ake amfani dashi ga duka aji da abubuwa, dalilin da yasa tebur ya nuna 24 ƙididdiga (kuma ba 23).

Decoreba

Yin ado bazai zama mafi kyawun hanyar koyo ba, amma da yawan karatu, wannan tip zai iya ceton ku a cikin lokaci “H”. Hanya mai sauƙi don yin ado da waɗannan alamu shine ta hanyar abubuwan ban mamaki. Babu shafi na Rogério Araújo yana da hanyar kere-kere, inda kawai zaka haddace jimloli biyu kuma tuni zaka iya yin kyakkyawan tsari, haka:

Ka'idojin HALITTU (5)

An ma'aikata m ya gina daya samfur kawai!

translation: Masana'antu (Hanyar Masana'antu) m (Ma'aikatar Abstract) ya gina (Magini) wani samfuri (Misali) kawai (Singleton).

Ka'idojin Fasaha (7)

A ponte saba shi ne hada na kayan ado a kan facade don nauyi Moscow na sani “Aproxymar”!

translation: Gada (Gada) saba (Adafta) an hada shi (Hadedde) na kayan ado (Mai ado) a kan facade (Façade) don nauyin tashi (Flyweight) idan "kusanci" (Wakili).

MAGANGANUN HALAYE (11)

Koyon wanda matsayin halitta da kuma tsari, sauran kuma mizani ne halayya.

Ra'ayoyi

(wucewa)

1

Adafta

(Tsarin gini)

Sanya fasalin fasalin aji zuwa wani fasalin, ana tsammanin abokan ciniki, barin azuzuwan tare da musayar musaya don aiki tare, menene, in ba haka ba, ba zai yuwu ba.

2

Façade

(Tsarin gini)

Bayar da tsari guda ɗaya, mafi girma zuwa ga tsarin haɗin keɓaɓɓen tsarin. a cikin wasu kalmomi, gabatar da kayan aiki don abubuwa daban-daban na API (tarin aji) a hanya mai sauƙi da sauƙi don amfani.

3

Hadedde

(Tsarin gini)

Enable daidaitaccen magani na abubuwan mutum da haɗakar waɗannan abubuwa.

4

Gada

(Tsarin gini)

Ma'aurata (su rabu) zane na aiwatarwar ku don dukansu zasu iya bambanta da kansu.

5

Singleton

(Halitta)

Tabbatar cewa aji yana da misali guda ɗaya kuma ya samar da hanyar samun damar duniya don shi.

6

Mai Lura

(Havabi'a)

Ineayyade dogaro ɗaya-da-yawa tsakanin abubuwa ta yadda idan abu ya canza yanayi, ana sanar da masu dogaro da kai tsaye.

7

Matsakanci

(Havabi'a)

Ayyade wani abu wanda zai lulluɓe yadda wasu abubuwa ke mu'amala.

8

Wakili

(Tsarin gini)

Bayar da canji ko ma'ana ta yadda abu zai iya sarrafa damar zuwa wani. An kuma san shi da suna.

9

Sarkar Nauyi

(Havabi'a)

Cascading abubuwa zuwa, ta hanyar ta, wakilta buƙata har sai abu yayi mata. Wannan yana hana haɗawa tsakanin mai aika buƙata da mai karɓa, ba da dama don abu fiye da ɗaya don ɗaukar buƙatun.

10

Flyweight

(Tsarin gini)

Yi amfani da rabawa don tallafawa ingantaccen abubuwa masu rikitarwa (lafiya granularity).

11

Magini

(Halitta)

Raba gina wani abu mai rikitarwa daga wakilcinsa domin tsarin gini iri daya ya iya kirkirar wakilai daban-daban.

12

Hanyar Masana'antu

(Halitta)

Ayyade keɓancewa don ƙirƙirar abu amma bari ƙananan ƙaramin juzu'i su yanke shawarar wane aji don saiti. Ba ka damar jinkirta instantiation don subclasses.

13

Ma'aikatar Abstract

(Halitta)

Bayar da haɗin kai don ƙirƙirar dangi masu alaƙa ko abubuwan dogaro ba tare da tantance takamaiman azuzuwan su ba.

14

Misali

(Halitta)

Bayyana nau'ikan don ƙirƙirar ta amfani da misali azaman samfuri kuma ƙirƙirar sababbin abubuwa yayin yin kwafin wannan samfurin.

15

Memento

(Havabi'a)

Adana yanayin cikin abu don ana iya dawo dashi daga baya (gyara).

16

Hanyar samfuri

(Havabi'a)

Ayyade kwarangwal na algorithm a cikin aiki, barin wasu matakai a cika su da ƙananan ƙananan matakai. Yana bawa ƙananan rukuninku damar sake fasalin wasu matakai na algorithm ba tare da canza tsarin sa ba.

17

Jiha

(Havabi'a)

Bada abu don canza halayen sa yayin da yanayin cikin sa ya canza.

18

Dabara

(Havabi'a)

Ayyade dangin algorithms, encapsulate kowane daya da sanya su musanyawa.

19

Umurni

(Havabi'a)

Sanya buƙata azaman abin, don abokan ciniki su daidaita buƙatun daban-daban.

20

Mai Tafsiri

(Havabi'a)

Ba harshe, ayyana wakilci don nahawunku ta hanyar mai fassara.

21

Mai ado

(Tsarin gini)

Ynamara ƙarfin ɗaura ƙarin nauyi a kan abu.

22

Mai gabatarwa

(Havabi'a)

Samar da wata hanya don samun damar abubuwa na abubuwan tarawa bi da bi ba tare da fallasa wakilcin cikin ta ba.

23

Baƙo

(Havabi'a)

Wakiltar wani aiki da za'ayi akan abubuwan tsarin abu. Yana baka damar ayyana sabon aiki ba tare da canza ajin abubuwanda yake aiki a cikinsu ba.

 

source

Rogério Araújo – Rayuwa, IT da Gasa

Jumillar adadin hits: 4782

Leave a Reply

Your email address ba za a buga. Bukata filayen suna alama da *