Go Design Patterns [Book] - O'Reilly Media

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

A highly practical guide filled with numerous examples unleashing the power of design patterns with Go. · Discover an introduction of the CSP concurrency model ... Skiptomaincontent GetfullaccesstoGoDesignPatternsand60K+othertitles,withfree10-daytrialofO'Reilly. There'salsoliveonlineevents,interactivecontent,certificationprepmaterials,andmore. Startyourfreetrial GoDesignPatterns byMarioCastroContreras ReleasedFebruary2017 Publisher(s):PacktPublishing ISBN:9781786466204 ExploreapreviewversionofGoDesignPatternsrightnow. O’Reillymembersgetunlimitedaccesstoliveonlinetrainingexperiences,plusbooks,videos,anddigitalcontentfrom200+publishers. Startyourfreetrial Bookdescription Learnidiomatic,efficient,clean,andextensibleGodesignandconcurrencypatternsbyusingTDDAboutThisBookAhighlypracticalguidefilledwithnumerousexamplesunleashingthepowerofdesignpatternswithGo.DiscoveranintroductionoftheCSPconcurrencymodelbyexplainingGoRoutinesandchannels.Getafullexplanation,includingcomprehensivetextandexamples,ofallknownGoFdesignpatternsinGo.WhoThisBookIsForThetargetaudienceisbothbeginner-andadvanced-leveldevelopersintheGoprogramminglanguage.Noknowledgeofdesignpatternsisexpected.WhatYouWillLearnAllbasicsyntaxandtoolsneededtostartcodinginGoEncapsulatethecreationofcomplexobjectsinanidiomaticwayinGoCreateuniqueinstancesthatcannotbeduplicatedwithinaprogramUnderstandtheimportanceofobjectencapsulationtoprovideclarityandmaintainabilityPreparecost-effectiveactionssothatdifferentpartsoftheprogramaren'taffectedbyexpensivetasksDealwithchannelsandGoRoutineswithintheGocontexttobuildconcurrentapplicationinGoinanidiomaticwayInDetailGoisamulti-paradigmprogramminglanguagethathasbuilt-infacilitiestocreateconcurrentapplications.Designpatternsallowdeveloperstoefficientlyaddresscommonproblemsfacedduringdevelopingapplications.GoDesignPatternswillprovidereaderswithareferencepointtosoftwaredesignpatternsandCSPconcurrencydesignpatternstohelpthembuildapplicationsinamoreidiomatic,robust,andconvenientwayinGo.ThebookstartswithabriefintroductiontoGoprogrammingessentialsandquicklymovesontoexplaintheideabehindthecreationofdesignpatternsandhowtheyappearedinthe90'sasacommon"language"betweendeveloperstosolvecommontasksinobject-orientedprogramminglanguages.Youwillthenlearnhowtoapplythe23GangofFour(GoF)designpatternsinGoandalsolearnaboutCSPconcurrencypatterns,the"killerfeature"inGothathashelpedGoogledevelopsoftwaretomaintainthousandsofservers.Withallofthisthebookwillenableyoutounderstandandapplydesignpatternsinanidiomaticwaythatwillproduceconcise,readable,andmaintainablesoftware.StyleandapproachThisbookwillteachwidelyuseddesignpatternsandbestpracticeswithGoinastep-by-stepmanner.Thecodewillhavedetailedexamples,toallowprogrammerstoapplydesignpatternsintheirday-to-daycoding. Showandhidemore Publisherresources DownloadExampleCode TableofcontentsProductinformation Tableofcontents GoDesignPatterns GoDesignPatterns Credits AbouttheAuthor AbouttheReviewer www.PacktPub.com Whysubscribe? CustomerFeedback Preface Whatthisbookcovers Whatyouneedforthisbook Whothisbookisfor Conventions Readerfeedback Customersupport Downloadingtheexamplecode Errata Piracy Questions 1.Ready...Steady...Go! Alittlebitofhistory InstallingGo Linux GoLinuxadvancedinstallation Windows MacOSX Settingtheworkspace-LinuxandAppleOSX StartingwithHelloWorld IntegratedDevelopmentEnvironment-IDE Types Variablesandconstants Operators Flowcontrol Theif...elsestatement Theswitchstatement Thefor…rangestatement Functions Whatdoesafunctionlook like? Whatisananonymousfunction? Closures Creatingerrors,handlingerrors andreturningerrors. Functionwithundeterminednumberofparameters Namingreturnedtypes Arrays,slices,andmaps Arrays Zero-initialization Slices Maps Visibility Zero-initialization Pointersandstructures Whatisapointer?Whyaretheygood? Structs Interfaces Interfaces-signingacontract TestingandTDD Thetestingpackage WhatisTDD? Libraries TheGogettool ManagingJSONdata Theencodingpackage Gotools Thegolinttool Thegofmttool Thegodoctool Thegoimporttool ContributingtoGoopensourceprojectsinGitHub Summary 2.CreationalPatterns-Singleton,Builder,Factory,Prototype,andAbstractFactoryDesignPatterns Singletondesignpattern-havingauniqueinstanceofatypeintheentireprogram Description Objectives Example-auniquecounter Requirementsandacceptancecriteria Writingunittestsfirst Implementation AfewwordsabouttheSingletondesignpattern Builderdesignpattern-reusinganalgorithmtocreatemanyimplementationsofaninterface Description Objectives Example-vehiclemanufacturing Requirementsandacceptancecriteria Unittestforthevehiclebuilder Implementation WrappinguptheBuilderdesignpattern Factorymethod-delegatingthecreationofdifferenttypesofpayments Description Objectives Theexample-afactoryofpaymentmethodsforashop Acceptancecriteria Firstunittest Implementation UpgradingtheDebitcardmethodtoanewplatform WhatwelearnedabouttheFactorymethod AbstractFactory-afactoryoffactories Description Theobjectives Thevehiclefactoryexample,again? Acceptancecriteria Unittest Implementation AfewlinesabouttheAbstractFactorymethod Prototypedesignpattern Description Objective Example Acceptancecriteria Unittest Implementation WhatwelearnedaboutthePrototypedesignpattern Summary 3.StructuralPatterns-Composite,Adapter,andBridgeDesignPatterns Compositedesignpattern Description Objectives Theswimmerandthefish Requirementsandacceptancecriteria Creatingcompositions BinaryTreecompositions Compositepatternversusinheritance FinalwordsontheCompositepattern Adapterdesignpattern Description Objectives UsinganincompatibleinterfacewithanAdapterobject Requirementsandacceptancecriteria UnittestingourPrinteradapter Implementation ExamplesoftheAdapterpatterninGo'ssourcecode WhattheGosourcecodetellsusabouttheAdapterpattern Bridgedesignpattern Description Objectives Twoprintersandtwowaysofprintingforeach Requirementsandacceptancecriteria UnittestingtheBridgepattern Implementation ReuseeverythingwiththeBridgepattern Summary 4.StructuralPatterns-Proxy,Facade,Decorator,andFlyweightDesignPatterns Proxydesignpattern Description Objectives Example Acceptancecriteria Unittest Implementation Proxyingaroundactions Decoratordesignpattern Description Objectives Example Acceptancecriteria Unittest Implementation Areal-lifeexample-servermiddleware Startingwiththecommoninterface,http.Handler AfewwordsaboutGo'sstructuraltyping SummarizingtheDecoratordesignpattern-ProxyversusDecorator Facadedesignpattern Description Objectives Example Acceptancecriteria Unittest Implementation LibrarycreatedwiththeFacadepattern Flyweightdesignpattern Description Objectives Example Acceptancecriteria Basicstructsandtests Implementation What'sthedifferencebetweenSingletonandFlyweightthen? Summary 5.BehavioralPatterns-Strategy,ChainofResponsibility,andCommandDesignPatterns Strategydesignpattern Description Objectives Renderingimagesortext Acceptancecriteria Implementation Solvingsmallissuesinourlibrary FinalwordsontheStrategypattern Chainofresponsibilitydesignpattern Description Objectives Amulti-loggerchain Unittest Implementation Whataboutaclosure? Puttingittogether Commanddesignpattern Description Objectives Asimplequeue Acceptancecriteria Implementation Moreexamples Chainofresponsibilityofcommands Rounding-uptheCommandpatternup Summary 6.BehavioralPatterns-Template,Memento,andInterpreterDesignPatterns Templatedesignpattern Description Objectives Example-asimplealgorithmwithadeferredstep Requirementsandacceptancecriteria Unittestsforthesimplealgorithm ImplementingtheTemplatepattern Anonymousfunctions Howtoavoidmodificationsontheinterface LookingfortheTemplatepatterninGo'ssourcecode SummarizingtheTemplatedesignpattern Mementodesignpattern Description Objectives Asimpleexamplewithstrings Requirementsandacceptancecriteria Unittest ImplementingtheMementopattern AnotherexampleusingtheCommandandFacadepatterns LastwordsontheMementopattern Interpreterdesignpattern Description Objectives Example-apolishnotationcalculator Acceptancecriteriaforthecalculator Unittestofsomeoperations Implementation ComplexitywiththeInterpreterdesignpattern Interpreterpatternagain-nowusinginterfaces ThepoweroftheInterpreterpattern Summary 7.BehavioralPatterns-Visitor,State,Mediator,andObserverDesignPatterns Visitordesignpattern Description Objectives Alogappender Acceptancecriteria Unittests ImplementationofVisitorpattern Anotherexample Visitorstotherescue! Statedesignpattern Description Objectives Asmallguessthenumbergame Acceptancecriteria ImplementationofStatepattern Astatetowinandastatetolose ThegamebuiltusingtheStatepattern Mediatordesignpattern Description Objectives Acalculator Acceptancecriteria Implementation UncouplingtwotypeswiththeMediator Observerdesignpattern Description Objectives Thenotifier Acceptancecriteria Unittests Implementation Summary 8.IntroductiontoGosConcurrency Alittlebitofhistoryandtheory Concurrencyversusparallelism CSPversusactor-basedconcurrency Goroutines OurfirstGoroutine AnonymousfunctionslaunchedasnewGoroutines WaitGroups Callbacks Callbackhell Mutexes Anexamplewithmutexes-concurrentcounter Presentingtheracedetector Channels Ourfirstchannel Bufferedchannels Directionalchannels Theselectstatement Rangingoverchannelstoo! Usingitall-concurrentsingleton Unittest Implementation Summary 9.ConcurrencyPatterns-Barrier,Future,andPipelineDesignPatterns Barrierconcurrencypattern Description Objectives AnHTTPGETaggregator Acceptancecriteria Unittest-integration Implementation WaitingforresponseswiththeBarrierdesignpattern Futuredesignpattern Description Objectives Asimpleasynchronousrequester Acceptancecriteria Unittests Implementation PuttingtheFuturetogether Pipelinedesignpattern Description Objectives Aconcurrentmulti-operation Acceptancecriteria Beginningwithtests Implementation Thelistgenerator Raisingnumberstothepowerof2 Finalreduceoperation LaunchingthePipelinepattern FinalwordsonthePipelinepattern Summary 10.ConcurrencyPatterns-WorkersPoolandPublish/SubscriberDesignPatterns Workerspool Description Objectives Apoolofpipelines Acceptancecriteria Implementation Thedispatcher Thepipeline Anappusingtheworkerspool Notests? WrappinguptheWorkerpool ConcurrentPublish/Subscriberdesignpattern Description Objectives Example-aconcurrentnotifier Acceptancecriteria Unittest Testingsubscriber Testingpublisher Implementation Implementingthepublisher Handlingchannelswithoutraceconditions AfewwordsontheconcurrentObserverpattern Summary Showandhidemore Productinformation Title:GoDesignPatterns Author(s):MarioCastroContreras Releasedate:February2017 Publisher(s):PacktPublishing ISBN:9781786466204 Youmightalsolike book 40AlgorithmsEveryProgrammerShouldKnow by ImranAhmad Learnalgorithmsforsolvingclassiccomputerscienceproblemswiththisconciseguidecoveringeverythingfromfundamental… book GoProgrammingCookbook-SecondEdition by AaronTorres TacklethetrickiestofproblemsinGoprogrammingwiththispracticalguideKeyFeaturesDevelopapplications… video CleanCode by RobertC.Martin ExpandedEdition(August2018)UpdatedwithDesignPatternsepisodesfromtheCleanCodeseriesfromClean… book Go:DesignPatternsforReal-WorldProjects by VladimirVivien, MarioCastroContreras, MatRyer AninsightfulguidetolearningtheGoprogramminglanguageAboutThisBookGetinsightfulcoverageof… Don’tleaveempty-handed GetMarkRichards’sSoftwareArchitecturePatternsebooktobetterunderstandhowtodesigncomponents—andhowtheyshouldinteract. It’syours,free. Getitnow Close



請為這篇文章評分?