Gang of Four Design Patterns - Spring Framework Guru

文章推薦指數: 80 %
投票人數:10人

The GoF Design Patterns are broken into three categories: Creational Patterns for the creation of objects; Structural Patterns to provide relationship between ... HomeStartHereCoursesIntrotoSpring(Free)SpringFramework5SpringBootMicroservicesTestingSpringBootSpringSecurityCoreSpringFramework4ApacheMavenDockerforJavaDevelopersSQLBeginnertoGuruGuruGearMyCoursesBlogWriteforSFGAboutContactGangofFourDesignPatternsHome›GangofFourDesignPatternsOver20yearsagotheiconiccomputersciencebook“DesignPatterns:ElementsofReusableObject-OrientedSoftware”wasfirstpublished.Thefourauthorsofthebook:ErichGamma,RichardHelm,RalphJohnson,andJohnVlissides,havesincebeendubbed“TheGangofFour”.Intechnologycircles,you’lloftenseethisnicknamedshortedtoGoF.EventhoughtheGoFDesignPatternsbookwaspublishedover20yearsago,itstillcontinuestobeanAmazonbestseller.TheGoFwrotethebookinaC++contextbutitstillremainsveryrelevanttoJavaprogramming.C++andJavaarebothobject-orientedlanguages.TheGoFauthors,throughtheirexperienceincodinglargescaleenterprisesystemsusingC++,sawcommonpatternsemerge.ThesedesignpatternsarenotuniquetoC++.Thedesignpatternscanbeappliedinanyobjectorientedlanguage.AsaJavadeveloperusingtheSpringFrameworktodevelopenterpriseclassapplications,youwillencountertheGoFDesignPatternsonadailybasis.TheGoFDesignPatternsarebrokenintothreecategories:CreationalPatternsforthecreationofobjects;StructuralPatternstoproviderelationshipbetweenobjects;andfinally,BehavioralPatternstohelpdefinehowobjectsinteract.GangofFourDesignPatternsCreationalDesignPatternsAbstractFactory.Allowsthecreationofobjectswithoutspecifyingtheirconcretetype.Builder.Usestocreatecomplexobjects.FactoryMethod.Createsobjectswithoutspecifyingtheexactclasstocreate.Prototype.Createsanewobjectfromanexistingobject.Singleton.Ensuresonlyoneinstanceofanobjectiscreated.StructuralDesignPatternsAdapter.Allowsfortwoincompatibleclassestoworktogetherbywrappinganinterfacearoundoneoftheexistingclasses.Bridge.Decouplesanabstractionsotwoclassescanvaryindependently.Composite.Takesagroupofobjectsintoasingleobject.Decorator.Allowsforanobject’sbehaviortobeextendeddynamicallyatruntime.Facade.Providesasimpleinterfacetoamorecomplexunderlyingobject.Flyweight.Reducesthecostofcomplexobjectmodels.Proxy.Providesaplaceholder interfacetoanunderlyingobjecttocontrolaccess,reducecost,orreducecomplexity.BehaviorDesignPatternsChainofResponsibility.Delegatescommandstoachainofprocessingobjects.Command.Createsobjectswhichencapsulateactionsandparameters.Interpreter.Implementsaspecializedlanguage.Iterator.Accessestheelementsofanobjectsequentiallywithoutexposingitsunderlyingrepresentation.Mediator.Allowsloosecouplingbetweenclassesbybeingtheonlyclassthathasdetailedknowledgeoftheirmethods.Memento.Providestheabilitytorestoreanobjecttoitspreviousstate.Observer.Is apublish/subscribepatternwhichallowsanumberofobserverobjectstoseeanevent.State.Allowsanobjecttoalteritsbehaviorwhenitsinternalstatechanges.Strategy.Allowsoneofafamilyofalgorithmstobeselectedon-the-flyatrun-time.TemplateMethod.Definestheskeletonofanalgorithmasanabstractclass,allowingitssub-classestoprovideconcretebehavior.Visitor.Separatesanalgorithmfromanobjectstructurebymovingthehierarchyofmethodsintooneobject.Save41commentson“GangofFourDesignPatterns”PiyushApril28,2015at1:00amWhenthereareonly3categorieswhycallitGANGOFFOUR?ReplyjtApril28,2015at5:14am“GangofFour”referstothefourauthorsofthebook–ErichGamma,RichardHelm,RalphJohnson,andJohnVlissides.ReplyRAVINovember4,2019at11:33pmbecausethesedesignepatrendeovlopedby4peopleReplyShankarKrishnaNovember15,2019at12:54amNothatreasonbro..abookcalleddesignpatterns:elementsofreusableoosoftwarewaswrittenby4personsnamely,erichgamma,richarthelm,ralphjohnsonandvlissides..ReplyMeFebruary28,2020at5:58amTherearefourauthors—anywayifthatwasthequestionyouaskthisisn’tthereadingmaterialforyouReplyJerimKauraDecember3,2020at8:15amPublishedbyFourAuthersReplyNikhilRaoApril30,2021at4:35amReason:FourPeoplepublishedthatBook.ReplyAlexOctober13,2021at8:47amWell,Iseeit’skindaatrendheretorepeattothisguythatitis4authors,notgroupsofpatterns,so…Dude,yougotitwrong!GoFmeans4authors!StupidReplyOOVIIMarch5,2018at2:15amJohn,appreciateyoureffortsinexplainingGoFpatternsindetailandalsowithgreatqualitycoveringOODesignprinciples,etc.Yourblogisoneofthetopbestwhichcoversthesepatterns.Thanksforsharingtheknowledge.ReplyjtMarch7,2018at4:36pmThanks!ReplyThamizhelangoMarch16,2018at5:19pmThanksJohn,ForexplainingDesignpatternswithexcellentexamples.ReplyJochenMarch27,2018at7:54amGiveonemoreitothevisitorinyourlastline😉ReplyGavinBeereApril12,2018at9:23amHiJohn,Couldyoupleasetellmeexactlywhichpatternsarebeingusedinasimplespringapplication.(BasicCRUDfunctionality)Regards,GavinReplycoryplusplusNovember27,2018at10:09amThispostkeepsmecomingbacktorefreshmyknowledge.Thankssomuch!ReplyAkashBabuDecember4,2018at3:14amIt’sagreatplacetolearndesignpatternsforpeoplewhowanttostartimplementingscalableapplications!!ThanksJohn,reallyappreciateyoureffortalot!ReplyjustinekaysDecember21,2018at11:41amFindingadesignpatternblogpostthatstitchestogetherideashasbeenchallenging.Thisbloghasbecomemygo-tosinceIstumbleduponit.Reallyloveyourstyleofwriting.IfI’dtoaddonethingthatcouldbeimproved,itwouldbeaddingpros/consaboutthepattern.ReplyJulesMansonJanuary15,2019at5:53pmIhaveanideaforaGoFDesignPatternsspin-off.Agoodsuggestednamemightbe:DesignPatternsIIElementsofReusableObject-OrientedandFunctionalJavascript(SpinoffgreatlyinspiredbyGang-of-FourDesignPatterns)InspiredbyoriginalGoFDesignPatternsa2ndeditionwouldbepublishedcitingall23orsocommonlyusedormostimportantdesignpatternsemployingonlyJavaScriptorrelatedwebdevelopmentlanguageswhereJavascriptexamplesarenotappropriateforexampleCSSvariablesorserverlessdatabases.Aproeditionwouldalsobeavailableforotherpatterns(perhaps32inall)notintheoriginalDesignPatternsbyGoF.AbstracttoconcreterealworldexampleswouldallbewrittenfromVanillatoNeapolitanflavoredJavascript.NeweditionwouldmakeverylimiteduseofjQuery.Examplesofin-the-wildpopularlibraries/frameworkswouldciteinstanceswheretheydiditrightandwheretheywentwrong.Notasingleuseofthenon-words“foo”and“bar”areprintedanywhereinthebookassuchabstractionsaresoblandandmeaninglessthatnoviceprogrammersoftenhavedifficultygraspingthecorelessonsbehindthem—noviceprogrammerslikeme.SeveraloutstandingbookshavealreadybeenwrittenforexampleLearningJavaScriptDesignPatterns(Volume1.7.0iscompletelyfreeonline)byAddyOsmani.Buttheexamplesaretooblandforme.Heshouldhavekadeuseofmorereal-worldexamplesespeciallyfromframeworks.Thereisalsoagreatwebsitecalledrefactoring.gurugivingoneatasteofdesignpatterns(alsoinspiredbyGoF)orthefullbookforasmallpricebutheusesfuckingcatsandotherdumbreal-worldobjectstodemonstrateuse-casesinUML.UMListoomuchofanabstraction.Beginnerstointermediateprogrammersneedreal-worldexampletoreallygraspthecoreideas.Myprogrammingskillsarefartoolowtowrite/co-writeortechnicallyreviewsuchabook.Butifsaidbookweretobepublishedlwouldbenearthetopofaverylonglisttoacquireaninitialbetarelease.Ijustwantedtothrowthatouttheretogetyourthoughts.Whatdoyouallthinkofthisidea?ReplybruhmomentAugust30,2019at12:25pmlmaoNO.ReplyJoshuaFieldsSeptember29,2020at3:59pmAwesomeidea.If“ChickenSoupfortheSoul”canmakespin-offsforeveryoneandtheirmother,whynotGoFstandards?Heck,makeabookforeachfrikinglanguage.Trustmethatyoudon’treallyneedtechnicalknow-howtowritethatbook.Youacquiretheknow-howasyouwriteit…Doit!!ReplySrimathiAugust18,2021at6:58amIagreewithhimReplyVickeyMay22,2019at3:36amIsthereanyarchitecturaldesignpattern??ReplyAnshSachdevaDecember11,2019at12:43amThanksforsharingsuchgreatknowledge.ReplyVinodJanuary28,2020at5:58amHi,Thissimpleexplanationforallthedesignpatternshelpsmealottounderstand.ReplyMadhusudanFebruary29,2020at5:27amIntemplatemethodpattern,mostoftheexamplesshowtemplatemethodasfinal.Isitnotnecessary?ReplyRobertLouisMarch13,2020at3:45pmHithere.MyFirefoxDeveloperEditionbrowsershowsthispagewithnobordernorpadding.Itwouldbenicerifthetextwasn’ttouchingtheedgeoftheframe.ReplyKarenJune6,2020at6:05pmWoowI’veworkedwithseveralofthesepatternsalready,butIwouldn’timaginethisbookwaspublishedin1994.Thoughtmanyoftheconceptsweremorerecent.Definitelyamustread.ReplyAshwiniOctober14,2020at6:47amHello.goodpost.Iaminterestedinwebdesignandyourinformationondesignpatternshelpedmealot.Thanksforsharingthiswithus.ReplyGeorgeAugust10,2021at3:33amIhatedtheDesignPatternbookwhenitcameoutbecauseIthoughtitwastedious(evenasaC++programmer)andtoomuchofitwasnotaspractical(awisesolution)formostfrequentlyencounteredproblems.Unfortunately,everybodyboughttoomuchintoiteventhoughitcontainsmanysoundideas.ItseemeduniversallyheraldedandIbelieveagreatmanypeopleboughtthebookandgotnothingoutofit.Thebookwasill-matchedfortoomanythatwereadvisedtoreadit.Asmall“goodparts”book,andmoreinpseudo-code,wouldhavehelpedimmenselymore.ReplyLeaveaReplyCancelReplyYouremailaddresswillnotbepublished.Requiredfieldsaremarked*CommentName*Email*WebsiteSavemyname,email,andwebsiteinthisbrowserforthenexttimeIcomment.ThissiteusesAkismettoreducespam.Learnhowyourcommentdataisprocessed.FreeIntrotoSpringBootOnlineCourseSpringBootOnlineCourseSpringSecurityCoreOnlineCourseTestingSpringBootTutorialRecentPostsSpringRetryJuly30,2021SpringBootCLIJuly30,2021ActuatorinSpringBootJuly24,2021InternationalizationwithSpringBootJuly24,2021UsingDequeinJavaJuly1,2021



請為這篇文章評分?