Enterprise Cake

Download Enterprise Cake

Post on 01-Dec-2014

2.579 views

Category:

Software

5 download

Embed Size (px)

DESCRIPTION

 

TRANSCRIPT

<ul><li> 1. EnterpriseCakeEnterpriseCake JamesWattsJamesWatts james.watts@cakephp.org </li> <li> 2. Cake Development Corporation whoamiwhoami / JamesWatts/ JamesWatts (@_JAMESWATTS_)(@_JAMESWATTS_) / InvolvedinOpenSourcesince2008/ InvolvedinOpenSourcesince2008 / Using PHPforthelast 10years/ Using PHPforthelast 10years / Corememberof CakePHP/ Corememberof CakePHP / Organizerof CakeFest/ Organizerof CakeFest / Teamleadat CakeDC/ Teamleadat CakeDC / Authorof XHTTP andDocMLspecs/ Authorof XHTTP andDocMLspecs / CakePHP2 ApplicationCookbook/ CakePHP2 ApplicationCookbook </li> <li> 3. Cake Development Corporation </li> <li> 4. Cake Development Corporation TheoryTheory </li> <li> 5. Cake Development Corporation WriteLessCodeWriteLessCode AndWriteFewerQueriesAndWriteFewerQueries </li> <li> 6. Cake Development Corporation Writinglesscodemeans...Writinglesscodemeans... &gt; Reducinglegacytomaintain&gt; Reducinglegacytomaintain &gt; Introducingfeweredgecases&gt; Introducingfeweredgecases &gt; Lessopportunityforhumanerror&gt; Lessopportunityforhumanerror &gt; Fasterdevelopment efforts&gt; Fasterdevelopment efforts &gt; Lesscodetotest andcover&gt; Lesscodetotest andcover &gt; Enjoyment factorincreases!&gt; Enjoyment factorincreases! </li> <li> 7. Cake Development Corporation CakePHPCakePHP PromotesPromotes LessCodeLessCode RapidApplicationDevelopmentRapidApplicationDevelopment </li> <li> 8. Cake Development Corporation ConventionOverConfigurationConventionOverConfiguration </li> <li> 9. Cake Development Corporation Don'tWorkAroundCakePHPDon'tWorkAroundCakePHP MakeFullUseOfFrameworkConventionsMakeFullUseOfFrameworkConventions </li> <li> 10. Cake Development Corporation Don'tReinventWheelsDon'tReinventWheels BeAwareOfTheBoredomFactor,AndTheDesireToHack!BeAwareOfTheBoredomFactor,AndTheDesireToHack! </li> <li> 11. Cake Development Corporation KeepItSimpleKeepItSimple CodeIsSimpleUntilCodeIsSimpleUntil YouYou MakeItComplicatedMakeItComplicated </li> <li> 12. Cake Development Corporation Don'tRepeatRepeatYourselfDon'tRepeatRepeatYourself TakeFullAdvantageOfComponents,BehaviorsAndHelpersTakeFullAdvantageOfComponents,BehaviorsAndHelpers </li> <li> 13. Cake Development Corporation DesignUp-FrontDesignUp-Front FollowYourBusinessObjectives,NotYourTechnicalSolutionFollowYourBusinessObjectives,NotYourTechnicalSolution </li> <li> 14. Cake Development Corporation TreatYourCodeAsProductTreatYourCodeAsProduct WriteProductionReadyCodeAsIfItWereForSomeoneElseWriteProductionReadyCodeAsIfItWereForSomeoneElse </li> <li> 15. Cake Development Corporation Command/QuerySeparationCommand/QuerySeparation SeparateactionsthatchangestatefromthosewhichconsultstateSeparateactionsthatchangestatefromthosewhichconsultstate </li> <li> 16. Cake Development Corporation BuildSOLIDCodeBuildSOLIDCode ApplyTheFirstFiveDesignPrinciplesToYourCodeApplyTheFirstFiveDesignPrinciplesToYourCode </li> <li> 17. Cake Development Corporation S.O.L.I.DS.O.L.I.D &gt; SingleResponsibilityPrincipal&gt; SingleResponsibilityPrincipal &gt; Open/ClosedPrincipal&gt; Open/ClosedPrincipal &gt; LiskovSubstitutionPrinciple&gt; LiskovSubstitutionPrinciple &gt; InterfaceSegregationPrinciple&gt; InterfaceSegregationPrinciple &gt; DependencyInversionPrinciple&gt; DependencyInversionPrinciple </li> <li> 18. Cake Development Corporation GetAGRASPOfYourCodeGetAGRASPOfYourCode General Responsibility AssignmentSoftwarePatternsGeneral Responsibility AssignmentSoftwarePatterns </li> <li> 19. Cake Development Corporation G.R.A.S.PG.R.A.S.P &gt; ControllerPattern&gt; ControllerPattern &gt; CreatorPattern&gt; CreatorPattern &gt; HighCohesion&gt; HighCohesion &gt; Indirection Pattern&gt; Indirection Pattern &gt; ExpertPrincipal&gt; ExpertPrincipal &gt; LowCoupling&gt; LowCoupling &gt; Polymorphism&gt; Polymorphism &gt; ProtectedVariations&gt; ProtectedVariations &gt; PureFabrication&gt; PureFabrication </li> <li> 20. Cake Development Corporation Don'tBeSTUPID!Don'tBeSTUPID! AvoidBadPracticesWhichWillWasteYourTimeLaterAvoidBadPracticesWhichWillWasteYourTimeLater </li> <li> 21. Cake Development Corporation S.T.U.P.I.DS.T.U.P.I.D &gt; Singleton&gt; Singleton &gt; Tight Coupling&gt; Tight Coupling &gt; Untestability&gt; Untestability &gt; PrematureOptimization&gt; PrematureOptimization &gt; IndescriptiveNaming&gt; IndescriptiveNaming &gt; Duplication&gt; Duplication </li> <li> 22. Cake Development Corporation KeepThingsInContextKeepThingsInContext TheLawOfDemeter,Don'tTalkToStrangersTheLawOfDemeter,Don'tTalkToStrangers </li> <li> 23. Cake Development Corporation DoesItScale?DoesItScale? IgnoreThePerformanceBenchmarksIgnoreThePerformanceBenchmarks </li> <li> 24. Cake Development Corporation Scalemeansmanythings...Scalemeansmanythings... &gt; Dataprocessing&gt; Dataprocessing &gt; Requestconcurrency&gt; Requestconcurrency &gt; Cachingstrategy&gt; Cachingstrategy &gt; Storageengine&gt; Storageengine &gt; Development effort&gt; Development effort &gt; Maintenancecost&gt; Maintenancecost </li> <li> 25. Cake Development Corporation ThinkAboutYourDataThinkAboutYourData YourDatabaseSchema IsYourAchillesHeelYourDatabaseSchema IsYourAchillesHeel </li> <li> 26. Cake Development Corporation ThinkAheadWithYourDataThinkAheadWithYourData AvoidStaleData,UseQueuing,CronTasksAnd Data WarehousingAvoidStaleData,UseQueuing,CronTasksAnd Data Warehousing </li> <li> 27. Cake Development Corporation AvoidTheHypeAvoidTheHype Don'tFollowTheHerd,BeGuidedOnlyBy ResultsDon'tFollowTheHerd,BeGuidedOnlyBy Results </li> <li> 28. Cake Development Corporation RespectTheProfessionRespectTheProfession TheCheaperAlternativeIsAlwaysMoreExpensiveLaterTheCheaperAlternativeIsAlwaysMoreExpensiveLater </li> <li> 29. Cake Development Corporation ReduceTechnicalDebtReduceTechnicalDebt BeRealisticAboutCornersYou Cut AndShortcutsYou TakeBeRealisticAboutCornersYou Cut AndShortcutsYou Take </li> <li> 30. Cake Development Corporation BudgetConstraintsAreRealBudgetConstraintsAreReal ContemplateFutureDealingOfAccumulated DebtContemplateFutureDealingOfAccumulated Debt </li> <li> 31. Cake Development Corporation VersionControlVersionControl ThereIsThereIs NONO ExcuseToNotVersion YourSourceCodeExcuseToNotVersion YourSourceCode </li> <li> 32. Cake Development Corporation Test,Test,TestTest,Test,Test ReduceCoverageReduceCoverage BeforeBefore YouAvoidTestingAnythingYouAvoidTestingAnything </li> <li> 33. Cake Development Corporation PracticePractice </li> <li> 34. Cake Development Corporation CakeDCGitWorkflowCakeDCGitWorkflow http://cakedc.com/git-workflowhttp://cakedc.com/git-workflow </li> <li> 35. Cake Development Corporation GitDevelopmentStrategyGitDevelopmentStrategy </li> <li> 36. Cake Development Corporation Stability,Quality&amp; ConsistencyStability,Quality&amp; Consistency </li> <li> 37. Cake Development Corporation Debug KitDebug Kit https://github.com/cakephp/debug_kithttps://github.com/cakephp/debug_kit </li> <li> 38. Cake Development Corporation CakeDCMigrationsCakeDCMigrations https://github.com/CakeDC/migrationshttps://github.com/CakeDC/migrations </li> <li> 39. Cake Development Corporation CakeDependencyCakeDependency https://github.com/jameswatts/cake-dependencyhttps://github.com/jameswatts/cake-dependency </li> <li> 40. Cake Development Corporation DIFeatures...DIFeatures... &gt; Registerclasses,objectsorcallbacks&gt; Registerclasses,objectsorcallbacks &gt; ConstructorandSetterinjection&gt; ConstructorandSetterinjection &gt; Lazyloading&gt; Lazyloading &gt; Dependencyscopes&gt; Dependencyscopes &gt; Observers&gt; Observers </li> <li> 41. Cake Development Corporation Registera ServiceRegistera Service Di::add('Foo', [ 'className' =&gt; 'Example', 'classPath' =&gt; 'Plugin.Path' ]); Di::add('Foo', $object); Di::add('Foo', function() use ($something) { // return service instance }); </li> <li> 42. Cake Development Corporation ConstructorAndSetterInjectionConstructorAndSetterInjection Di::add('Foo', [ 'className' =&gt; 'Example', 'classPath' =&gt; 'Plugin.Path', 'params' =&gt; [ 'bar' =&gt; Di::load('Bar') ] ]); Di::add('Foo', [ 'className' =&gt; 'Example', 'classPath' =&gt; 'Plugin.Path', 'setters' =&gt; [ 'setBar' =&gt; [ 'bar' =&gt; Di::load('Bar') ] ] ]); </li> <li> 43. Cake Development Corporation UsingObserversUsingObservers Di::observe([ 'MyInterface', 'AbstractClass' ], [ 'setters' =&gt; [ 'setFactory' =&gt; Di::load('Factory') ] ]); </li> <li> 44. Cake Development Corporation CakeToolkitCakeToolkit https://github.com/jameswatts/cake-toolkithttps://github.com/jameswatts/cake-toolkit </li> <li> 45. Cake Development Corporation CTKFeatures...CTKFeatures... &gt; Object-orienteddesign&gt; Object-orienteddesign &gt; Abstractionandencapsulation&gt; Abstractionandencapsulation &gt; Separationofconcerns&gt; Separationofconcerns &gt; Extensiblearchitecture&gt; Extensiblearchitecture &gt; Plug andplay&gt; Plug andplay &gt; Legacysupport&gt; Legacysupport </li> <li> 46. Cake Development Corporation Object-Oriented ViewsObject-Oriented Views class IndexView extends CtkView { public $factories = ['Ctk.Html', 'Ctk.Js']; public function build() { // create a HTML div $div = $this-&gt;Html-&gt;Div(); // create a HTML button $button = $this-&gt;Html-&gt;Button([ 'value' =&gt; __('Click Me') ]); // add the button to the div $div-&gt;add($button); // add the div to the view $this-&gt;add($div); } } </li>...</ul>