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

Up-Down Development and "DSL-first" approach

Up-Down Development and "DSL-first" approach

Volodymyr Melnyk

November 22, 2015
Tweet

More Decks by Volodymyr Melnyk

Other Decks in Programming

Transcript

  1. Who am I? • Software craftsman with ~7y experience •

    Atheist • Libertarian and anarchs- capitalist • Scientist and skeptic • A man with business/ economics mind
  2. before_create :set_user class GodObjectsManager validates :user, on: create, unless: ->

    (r) { r.is_valid? } def index
 if user
 …
 if category
 elsif order.price > 100500 end else # TODO: fix this end end before_action :do_something, only: [:index, :show] @user = User.joins(:roles).where(params[:user_id]) describe “index” do
 it “should be success” do
 expect(response.status).to be 200
 end end Spaghetti - Oriented Development
  3. Presentation Layer Presentation Layer is the same as User Interface

    and is responsible for presenting data to user and interpreting user’s commands. We can split it conventionally to forms and views.
  4. Application Layer It defines tasks that application should do and

    coordinates them between Domain Entities/ Aggregates and Services.
  5. Domain Layer Domain Layer or Model Layer or Domain Model

    Layer is the main part of your app, which stores all domain-specific logic and describes business-processes that are automatized with the help it.
  6. D is for Dependency Inversion Principle Split off your app

    on layers that should not be dependent on layers below.
  7. • Write unit tests for screen or screens of a

    feature for your presentation layer. • White correct static presentation code which passes the tests. • Add more contexts and edge-cases to your tests. • Update UI for new tests. • Make UI dynamic through adding mocked Domain Model and Application layers (refactor).
  8. • Great abstraction and single interface for all SOAP/ RESTful

    APIs. • No vendor lock. • Easy to read and maintain code. • Smaller number of code defects.