SOLID

From Wikipedia
Jump to navigation Jump to search

Kuhlelo lwamakhompiyutha olwenzelwe into, i- SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) isichazamazwi se- mnemonic sezinqubomgomo ezinhlanu zokuklama okuhloswe ngazo ukwenza ukwakheka kwesoftware kuqondeke kakhudlwana, kube nezimo futhi kulondolozwe . Ayihlobene nemigomo yokwakhiwa kwesoftware ye- GRASP . Lezi zimiso zingaphansi kwezimiso eziningi ezithuthukiswa ngunjiniyela wesoftware waseMelika kanye nomqeqeshi uRobert C. Martin . [1] [2] [3] Noma zisebenza kunoma yikuphi ukwakheka okugxilwe entweni, imigomo ye-SOLID nayo ingakha ifilosofi eyisisekelo yezindlela ezinjengokuthuthuka ngokuphuthuma noma ukuthuthukiswa kwesoftware . Umbono wemigomo ye-SOLID wethulwa nguMartin lakhe le-2000 Design Design and Designs Design, [4] yize isigaxa se-SOLID sangeniswa kamuva nguMichael Feather. [5]

Imiqondo[hlela | Hlela umthombo]

Umgomo wesibopho esisodwa [6]
Isigaba kufanele sibe nesibopho esisodwa, okungukuthi, izinguquko engxenyeni eyodwa yokucaciswa kwesoftware kuphela okufanele zikwazi ukuthinta okubekiwe kwesigaba.
Umgomo ovaliwe [7]
"Izinhlaka zesoftware   ... kufanele ivulelwe ukunwetshwa, kepha ivalelwe ukuguqulwa. "
Umgomo wokufaka esikhundleni weLiskov [8]
"Izinhloso ezinhlelweni kufanele zibambezelwe ngezigatshana zezincazelo zazo ngaphandle kokushintsha ukunemba kwalolo hlelo." Bheka futhi ukwakhiwa ngenkontileka .
Umgomo wokuhlukanisa [9]
"Izindawo eziningi eziqondene namakhasimende zingcono kune-interface eyodwa yenhloso ejwayelekile." [4]
Umgomo wokuncika wokuncika [10]
Umuntu kufanele "ancike kokukhishwayo (abstended), [hhayi] kokucindezelwayo kufakwe ndawonye (concretions)."
  1. Robert C. Martin. "Principles Of OOD". http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod. 
  2. Robert C. Martin. "Getting a SOLID start". https://sites.google.com/site/unclebobconsultingllc/getting-a-solid-start. 
  3. Sandi Metz. "SOLID Object-Oriented Design". https://www.youtube.com/watch?v=v-2yFMzxqwU. 
  4. 4.0 4.1 Robert C. Martin. "Design Principles and Design Patterns". http://www.objectmentor.com/resources/articles/Principles_and_Patterns.pdf. 
  5. Fenton, Steve (2017). Pro TypeScript: Application-Scale JavaScript Development. ISBN 9781484232491. https://books.google.co.uk/books?id=ZEtADwAAQBAJ&pg=PA108. 
  6. "Single Responsibility Principle". Archived from the original on 1 June 2015. https://web.archive.org/web/20150202200348/http://www.objectmentor.com/resources/articles/srp.pdf. 
  7. "Open/Closed Principle". Archived from the original on 5 September 2015. https://web.archive.org/web/20150905081105/http://www.objectmentor.com/resources/articles/ocp.pdf. 
  8. "Liskov Substitution Principle". Archived from the original on 5 September 2015. https://web.archive.org/web/20150905081111/http://www.objectmentor.com/resources/articles/lsp.pdf. 
  9. "Interface Segregation Principle". Archived from the original on 5 September 2015. https://web.archive.org/web/20150905081110/http://www.objectmentor.com/resources/articles/isp.pdf. 
  10. "Dependency Inversion Principle". Archived from the original on 5 September 2015. https://web.archive.org/web/20150905081103/http://www.objectmentor.com/resources/articles/dip.pdf.