Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Wrangling Large Ruby Codebases @ Rocky Mountain...

shagemann
September 21, 2012

Wrangling Large Ruby Codebases @ Rocky Mountain Ruby 2012

As Rails applications grow they see a lot of the same problems that any enterprise level software project will see at some point: longer running test suites, more complex code interaction, and a rising requirement to keep "all that stuff" in your head at once.

Rails may have been a framework for single applications in the past, but it nowadays has some features that allow you to tackle bigger projects with more ease. We'll cover Rails code structuring techniques like unbuilt gems and engines that you can use to get faster test suites, cleaner structures, and more flexible apps.

shagemann

September 21, 2012
Tweet

More Decks by shagemann

Other Decks in Programming

Transcript

  1. Disclaimer: nothing I might say other people say, they actually

    say. except when I say so. Monday, September 24, 2012
  2. ACCOUNT_DELETER.RB ACCOUNT_DELETION.RB APP_CONFIG.RB ASPECT.RB ASPECT_MEMBERSHIP.RB ASPECT_VISIBILITY.RB BLOCK.RB COMMENT.RB CONTACT.RB CONVERSATION.RB

    CONVERSATION_VISIBILITY.RB FEATURE_FLAGGER.RB INVITATION.RB INVITATION_CODE.RB LIKE.RB MENTION.RB MESSAGE.RB NOTIFICATION.RB NOTIFICATION_ACTOR.RB O_EMBED_CACHE.RB OAUTH2_PROVIDER_MODELS_ACTIVERECORD_AUTHORIZATION.RB OAUTH2_PROVIDER_MODELS_ACTIVERECORD_CLIENT.RB PARTICIPATION.RB PERSON.RB PHOTO.RB POD.RB POST.RB PROFILE.RB RELAYABLE_RETRACTION.RB REQUEST.RB RESHARE.RB RETRACTION.RB ROLE.RB SERVICE.RB SERVICE_USER.RB SHARE_VISIBILITY.RB SIGNED_RETRACTION.RB STATUS_MESSAGE.RB TAG_FOLLOWING.RB USER.RB USER_PREFERENCE.RB Monday, September 24, 2012
  3. Yehuda is like: grmpf! that’s like throwing all that on

    a big pile!! Ugly Monday, September 24, 2012
  4. Structured Prevent the big pile Comprehendible Prevent cognitive overload Agile

    Allow for change Focused Allow for concentration Monday, September 24, 2012
  5. ACCOUNT_DELETER.RB ACCOUNT_DELETION.RB APP_CONFIG.RB ASPECT.RB ASPECT_MEMBERSHIP.RB ASPECT_VISIBILITY.RB BLOCK.RB COMMENT.RB CONTACT.RB CONVERSATION.RB

    CONVERSATION_VISIBILITY.RB FEATURE_FLAGGER.RB INVITATION.RB INVITATION_CODE.RB LIKE.RB MENTION.RB MESSAGE.RB NOTIFICATION.RB NOTIFICATION_ACTOR.RB O_EMBED_CACHE.RB OAUTH2_PROVIDER_MODELS_ACTIVERECORD_AUTHORIZATION.RB OAUTH2_PROVIDER_MODELS_ACTIVERECORD_CLIENT.RB PARTICIPATION.RB PERSON.RB PHOTO.RB POD.RB POST.RB PROFILE.RB RELAYABLE_RETRACTION.RB REQUEST.RB RESHARE.RB RETRACTION.RB ROLE.RB SERVICE.RB SERVICE_USER.RB SHARE_VISIBILITY.RB SIGNED_RETRACTION.RB STATUS_MESSAGE.RB TAG_FOLLOWING.RB USER.RB USER_PREFERENCE.RB Monday, September 24, 2012
  6. ACCOUNT_DELETER.RB ACCOUNT_DELETION.RB APP_CONFIG.RB ASPECT.RB ASPECT_MEMBERSHIP.RB ASPECT_VISIBILITY.RB BLOCK.RB COMMENT.RB CONTACT.RB CONVERSATION.RB

    CONVERSATION_VISIBILITY.RB FEATURE_FLAGGER.RB INVITATION.RB INVITATION_CODE.RB LIKE.RB MENTION.RB MESSAGE.RB NOTIFICATION.RB NOTIFICATION_ACTOR.RB O_EMBED_CACHE.RB OAUTH2_PROVIDER_MODELS_ACTIVERECORD_A OAUTH2_PROVIDER_MODELS_ACTIVERECORD_C PARTICIPATION.RB PERSON.RB PHOTO.RB POD.RB POST.RB PROFILE.RB RELAYABLE_RETRACTION.RB REQUEST.RB RESHARE.RB RETRACTION.RB ROLE.RB SERVICE.RB SERVICE_USER.RB SHARE_VISIBILITY.RB SIGNED_RETRACTION.RB STATUS_MESSAGE.RB TAG_FOLLOWING.RB USER.RB USER_PREFERENCE.RB Monday, September 24, 2012
  7. ACCOUNT_DELETER.RB ACCOUNT_DELETION.RB APP_CONFIG.RB ASPECT.RB ASPECT_MEMBERSHIP.RB ASPECT_VISIBILITY.RB BLOCK.RB COMMENT.RB CONTACT.RB CONVERSATION.RB

    CONVERSATION_VISIBILITY.RB FEATURE_FLAGGER.RB INVITATION.RB INVITATION_CODE.RB LIKE.RB MENTION.RB MESSAGE.RB NOTIFICATION.RB NOTIFICATION_ACTOR.RB O_EMBED_CACHE.RB OAUTH2_PROVIDER_MODELS_ACTIVERECORD_A OAUTH2_PROVIDER_MODELS_ACTIVERECORD_C PARTICIPATION.RB PERSON.RB PHOTO.RB POD.RB POST.RB PROFILE.RB RELAYABLE_RETRACTION.RB REQUEST.RB RESHARE.RB RETRACTION.RB ROLE.RB SERVICE.RB SERVICE_USER.RB SHARE_VISIBILITY.RB SIGNED_RETRACTION.RB STATUS_MESSAGE.RB TAG_FOLLOWING.RB USER.RB USER_PREFERENCE.RB Monday, September 24, 2012
  8. ACCOUNT_DELETER.RB ACCOUNT_DELETION.RB APP_CONFIG.RB ASPECT.RB ASPECT_MEMBERSHIP.RB ASPECT_VISIBILITY.RB BLOCK.RB COMMENT.RB CONTACT.RB CONVERSATION.RB

    CONVERSATION_VISIBILITY.RB FEATURE_FLAGGER.RB INVITATION.RB INVITATION_CODE.RB LIKE.RB MENTION.RB MESSAGE.RB NOTIFICATION.RB NOTIFICATION_ACTOR.RB O_EMBED_CACHE.RB OAUTH2_PROVIDER_MODELS_ACTIVERECORD_A OAUTH2_PROVIDER_MODELS_ACTIVERECORD_C PARTICIPATION.RB PERSON.RB PHOTO.RB POD.RB POST.RB PROFILE.RB RELAYABLE_RETRACTION.RB REQUEST.RB RESHARE.RB RETRACTION.RB ROLE.RB SERVICE.RB SERVICE_USER.RB SHARE_VISIBILITY.RB SIGNED_RETRACTION.RB STATUS_MESSAGE.RB TAG_FOLLOWING.RB USER.RB USER_PREFERENCE.RB User OAuth Interaction Memberships Don’t know Visibility Retraction Monday, September 24, 2012
  9. Structured One more level at least! Comprehendible Modules might make

    sense Agile No change Focused Can’t prove it Monday, September 24, 2012
  10. I am like: Yes, but don’t put PaymentGateway in lib,

    put it in a gem! Monday, September 24, 2012
  11. Choose modules that tell the story of the system and

    contain a cohesive set of concepts -- Eric Evans Monday, September 24, 2012
  12. Choose modules that tell the story of the system and

    contain a cohesive set of concepts -- Eric Evans Monday, September 24, 2012
  13. Structured Yes! Comprehendible The gem is only dealing with its

    stuff Agile git submodule? separate repo? hm. Focused Yes! And you can prove it! Monday, September 24, 2012
  14. Current Pivotal project Availability and Booking Rails Travel Site Payment

    Gateway Conversion Tracking Monday, September 24, 2012
  15. Rails::Engine allows you to wrap a specific Rails application or

    subset of functionality and share it with other applications. -- http://api.rubyonrails.org/ Monday, September 24, 2012
  16. Rails::Engine allows you to wrap a specific Rails application or

    subset of functionality and share it with yourself. -- Me Monday, September 24, 2012
  17. Current Pivotal Project Rails TV Shows with Social Network Global

    Admin Show Admin SMS Interface Social Network Publisher Admin UI Users and Channels Monday, September 24, 2012
  18. If you do them right, they tell the story of

    your app Monday, September 24, 2012
  19. “The secret to building large apps is never build large

    apps. Break your application into small pieces. Then, assemble those testable, bite-sized pieces into your big application” -- Justin Meyer, JavascriptMVC Monday, September 24, 2012