Enterprise Cake
Upcoming SlideShare
Loading in...5
×
 

Enterprise Cake

on

  • 2,214 views

 

Statistics

Views

Total Views
2,214
Views on SlideShare
1,951
Embed Views
263

Actions

Likes
11
Downloads
53
Comments
0

5 Embeds 263

https://twitter.com 250
http://lanyrd.com 5
https://tweetdeck.twitter.com 4
http://www.slideee.com 3
http://cakefest.org 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Enterprise Cake Enterprise Cake Presentation Transcript

  • EnterpriseCakeEnterpriseCake JamesWattsJamesWatts james.watts@cakephp.org
  • 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
  • Cake Development Corporation
  • Cake Development Corporation TheoryTheory
  • Cake Development Corporation WriteLessCodeWriteLessCode AndWriteFewerQueriesAndWriteFewerQueries
  • Cake Development Corporation Writinglesscodemeans...Writinglesscodemeans... > Reducinglegacytomaintain> Reducinglegacytomaintain > Introducingfeweredgecases> Introducingfeweredgecases > Lessopportunityforhumanerror> Lessopportunityforhumanerror > Fasterdevelopment efforts> Fasterdevelopment efforts > Lesscodetotest andcover> Lesscodetotest andcover > Enjoyment factorincreases!> Enjoyment factorincreases!
  • Cake Development Corporation CakePHPCakePHP PromotesPromotes LessCodeLessCode RapidApplicationDevelopmentRapidApplicationDevelopment
  • Cake Development Corporation ConventionOverConfigurationConventionOverConfiguration
  • Cake Development Corporation Don'tWorkAroundCakePHPDon'tWorkAroundCakePHP MakeFullUseOfFrameworkConventionsMakeFullUseOfFrameworkConventions
  • Cake Development Corporation Don'tReinventWheelsDon'tReinventWheels BeAwareOfTheBoredomFactor,AndTheDesireToHack!BeAwareOfTheBoredomFactor,AndTheDesireToHack!
  • Cake Development Corporation KeepItSimpleKeepItSimple CodeIsSimpleUntilCodeIsSimpleUntil YouYou MakeItComplicatedMakeItComplicated
  • Cake Development Corporation Don'tRepeatRepeatYourselfDon'tRepeatRepeatYourself TakeFullAdvantageOfComponents,BehaviorsAndHelpersTakeFullAdvantageOfComponents,BehaviorsAndHelpers
  • Cake Development Corporation DesignUp-FrontDesignUp-Front FollowYourBusinessObjectives,NotYourTechnicalSolutionFollowYourBusinessObjectives,NotYourTechnicalSolution
  • Cake Development Corporation TreatYourCodeAsProductTreatYourCodeAsProduct WriteProductionReadyCodeAsIfItWereForSomeoneElseWriteProductionReadyCodeAsIfItWereForSomeoneElse
  • Cake Development Corporation Command/QuerySeparationCommand/QuerySeparation SeparateactionsthatchangestatefromthosewhichconsultstateSeparateactionsthatchangestatefromthosewhichconsultstate
  • Cake Development Corporation BuildSOLIDCodeBuildSOLIDCode ApplyThe“FirstFive”DesignPrinciplesToYourCodeApplyThe“FirstFive”DesignPrinciplesToYourCode
  • Cake Development Corporation S.O.L.I.DS.O.L.I.D > SingleResponsibilityPrincipal> SingleResponsibilityPrincipal > Open/ClosedPrincipal> Open/ClosedPrincipal > LiskovSubstitutionPrinciple> LiskovSubstitutionPrinciple > InterfaceSegregationPrinciple> InterfaceSegregationPrinciple > DependencyInversionPrinciple> DependencyInversionPrinciple
  • Cake Development Corporation GetAGRASPOfYourCodeGetAGRASPOfYourCode General Responsibility AssignmentSoftwarePatternsGeneral Responsibility AssignmentSoftwarePatterns
  • Cake Development Corporation G.R.A.S.PG.R.A.S.P > ControllerPattern> ControllerPattern > CreatorPattern> CreatorPattern > HighCohesion> HighCohesion > Indirection Pattern> Indirection Pattern > ExpertPrincipal> ExpertPrincipal > LowCoupling> LowCoupling > Polymorphism> Polymorphism > ProtectedVariations> ProtectedVariations > PureFabrication> PureFabrication
  • Cake Development Corporation Don'tBeSTUPID!Don'tBeSTUPID! AvoidBadPracticesWhichWillWasteYourTimeLaterAvoidBadPracticesWhichWillWasteYourTimeLater
  • Cake Development Corporation S.T.U.P.I.DS.T.U.P.I.D > Singleton> Singleton > Tight Coupling> Tight Coupling > Untestability> Untestability > PrematureOptimization> PrematureOptimization > IndescriptiveNaming> IndescriptiveNaming > Duplication> Duplication
  • Cake Development Corporation KeepThingsInContextKeepThingsInContext TheLawOfDemeter,Don'tTalkToStrangersTheLawOfDemeter,Don'tTalkToStrangers
  • Cake Development Corporation DoesItScale?DoesItScale? IgnoreThePerformanceBenchmarksIgnoreThePerformanceBenchmarks
  • Cake Development Corporation Scalemeansmanythings...Scalemeansmanythings... > Dataprocessing> Dataprocessing > Requestconcurrency> Requestconcurrency > Cachingstrategy> Cachingstrategy > Storageengine> Storageengine > Development effort> Development effort > Maintenancecost> Maintenancecost
  • Cake Development Corporation ThinkAboutYourDataThinkAboutYourData YourDatabaseSchema IsYourAchillesHeelYourDatabaseSchema IsYourAchillesHeel
  • Cake Development Corporation ThinkAheadWithYourDataThinkAheadWithYourData AvoidStaleData,UseQueuing,CronTasksAnd Data WarehousingAvoidStaleData,UseQueuing,CronTasksAnd Data Warehousing
  • Cake Development Corporation AvoidTheHypeAvoidTheHype Don'tFollowTheHerd,BeGuidedOnlyBy ResultsDon'tFollowTheHerd,BeGuidedOnlyBy Results
  • Cake Development Corporation RespectTheProfessionRespectTheProfession TheCheaperAlternativeIsAlwaysMoreExpensiveLaterTheCheaperAlternativeIsAlwaysMoreExpensiveLater
  • Cake Development Corporation ReduceTechnicalDebtReduceTechnicalDebt BeRealisticAboutCornersYou Cut AndShortcutsYou TakeBeRealisticAboutCornersYou Cut AndShortcutsYou Take
  • Cake Development Corporation BudgetConstraintsAreRealBudgetConstraintsAreReal ContemplateFutureDealingOfAccumulated DebtContemplateFutureDealingOfAccumulated Debt
  • Cake Development Corporation VersionControlVersionControl ThereIsThereIs NONO ExcuseToNotVersion YourSourceCodeExcuseToNotVersion YourSourceCode
  • Cake Development Corporation Test,Test,TestTest,Test,Test ReduceCoverageReduceCoverage BeforeBefore YouAvoidTestingAnythingYouAvoidTestingAnything
  • Cake Development Corporation PracticePractice
  • Cake Development Corporation CakeDCGitWorkflowCakeDCGitWorkflow http://cakedc.com/git-workflowhttp://cakedc.com/git-workflow
  • Cake Development Corporation GitDevelopmentStrategyGitDevelopmentStrategy
  • Cake Development Corporation Stability,Quality& ConsistencyStability,Quality& Consistency
  • Cake Development Corporation Debug KitDebug Kit https://github.com/cakephp/debug_kithttps://github.com/cakephp/debug_kit
  • Cake Development Corporation CakeDCMigrationsCakeDCMigrations https://github.com/CakeDC/migrationshttps://github.com/CakeDC/migrations
  • Cake Development Corporation CakeDependencyCakeDependency https://github.com/jameswatts/cake-dependencyhttps://github.com/jameswatts/cake-dependency
  • Cake Development Corporation DIFeatures...DIFeatures... > Registerclasses,objectsorcallbacks> Registerclasses,objectsorcallbacks > ConstructorandSetterinjection> ConstructorandSetterinjection > Lazyloading> Lazyloading > Dependencyscopes> Dependencyscopes > Observers> Observers
  • Cake Development Corporation Registera ServiceRegistera Service Di::add('Foo', [ 'className' => 'Example', 'classPath' => 'Plugin.Path' ]); Di::add('Foo', $object); Di::add('Foo', function() use ($something) { // return service instance });
  • Cake Development Corporation ConstructorAndSetterInjectionConstructorAndSetterInjection Di::add('Foo', [ 'className' => 'Example', 'classPath' => 'Plugin.Path', 'params' => [ 'bar' => Di::load('Bar') ] ]); Di::add('Foo', [ 'className' => 'Example', 'classPath' => 'Plugin.Path', 'setters' => [ 'setBar' => [ 'bar' => Di::load('Bar') ] ] ]);
  • Cake Development Corporation UsingObserversUsingObservers Di::observe([ 'MyInterface', 'AbstractClass' ], [ 'setters' => [ 'setFactory' => Di::load('Factory') ] ]);
  • Cake Development Corporation CakeToolkitCakeToolkit https://github.com/jameswatts/cake-toolkithttps://github.com/jameswatts/cake-toolkit
  • Cake Development Corporation CTKFeatures...CTKFeatures... > Object-orienteddesign> Object-orienteddesign > Abstractionandencapsulation> Abstractionandencapsulation > Separationofconcerns> Separationofconcerns > Extensiblearchitecture> Extensiblearchitecture > Plug andplay> Plug andplay > Legacysupport> Legacysupport
  • 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->Html->Div(); // create a HTML button $button = $this->Html->Button([ 'value' => __('Click Me') ]); // add the button to the div $div->add($button); // add the div to the view $this->add($div); } }
  • Cake Development Corporation ViewExtensibilityViewExtensibility class IndexView extends CtkView { public $factories = ['Ctk.Html', 'Ctk.Js']; public function build() { $div = $this->Html->Div(); $div->add($this->buildButton()); $this->add($div); } public function buildButton($value) { return $this->Html->Button([ 'value' => __($value) ]); } }
  • Cake Development Corporation AttachingEventsAttachingEvents // create a HTML button $button = $this->Html->Button([ 'value' => __('Click Me') ]); // bind an event to the button $button->bind('click', $this->Js->Alert([ 'text' => __('Hello World') ]));
  • Cake Development Corporation ReusingObjectsInLegacyViewsReusingObjectsInLegacyViews <div id=”example”> <?php echo $this->Factory->Html->Span([ 'text' => __('Hello World') ]); ?> </div>
  • Cake Development Corporation CakeMarkupLanguageCakeMarkupLanguage https://github.com/jameswatts/cake-markup-languagehttps://github.com/jameswatts/cake-markup-language
  • Cake Development Corporation CakeMLFeatures...CakeMLFeatures... > Familiarsyntax> Familiarsyntax > Readyfordesigners> Readyfordesigners > Simpletemplating> Simpletemplating > Extensiblebydesign> Extensiblebydesign > Plug andplay> Plug andplay > Legacysupport> Legacysupport
  • Cake Development Corporation MarkupMarkup <div id="example"> <cake:out value="Hello World" /> </div> <div id="%{foo}"> <cake:out value="#{Hola Mundo}" /> </div> <cake:out value="%{foo}" default="Nothing here" />
  • Cake Development Corporation ControlStructuresControlStructures <php:if expr="!empty(%{foo})"> <cake:out value="%{foo}" /> <php:else /> <cake:out value="Oops, no value" /> </php:if> <php:foreach var="products" default="No products found"> <cake:out value="%{COUNT}. %{KEY} = %{VALUE}" /> </php:foreach>
  • Cake Development Corporation FrameworkFeaturesFrameworkFeatures <cake:link value="#{Blog}" url="['controller' => 'Posts']" /> <cake:form model="Post" options="['action' => 'add']"> <cake:input field="Post.title" /> </cake:form> <cake:helper name="Foo" call="run" args="['bar', 123]" /> <cake:element name="sidebar" options="['foo' => %{bar}]" />
  • Cake Development Corporation ThanksThanks
  • Cake Development Corporation CakePHP2ApplicationCookbookCakePHP2ApplicationCookbook https://packtpub.com/web-development/cakephp-2-application-cookbookhttps://packtpub.com/web-development/cakephp-2-application-cookbook