Skip to content

Latest commit

 

History

History
202 lines (195 loc) · 7.79 KB

todo.org

File metadata and controls

202 lines (195 loc) · 7.79 KB

doodle to do list

Specs to add [/]

  • attr do … end initialization

documentation [0/3]

  • [ ] cover all features
    • reference doc
  • [ ] tutorial
    • more & better examples
  • [ ] redo website as multiple pages

less intrusiveness [1/2]

  • [ ] move more things into __doodle__
    • e.g. all methods which could be functions can be class methods
      • ones which don’t rely on instance variables
  • [X] perhaps have a single doodle method e.g. doodle.validations, doodle.convert, etc.
  • doodle, has, must, from, arg_order
  • could use arg checking trick for doodle
    • if no args, return DoodleInfo
    • if block, enter doodle context

equivalence [4/4]

  • [X] sorting
  • [X] comparison
  • [X] equality

See Facets compare_on

  • [X] could compare attributes in arg_order by default

pretty_print [1/1]

  • [X] pp doesn’t seem to like Doodle anymore

collect [2/2]

  • [X] Hash version has :list, :collect => Item, :key => :name
  • [X] create spec for bug in validate! with loading YAML when default defined
    • see spec/bugs_spec.rb ‘loading bad data from yaml with default defined’

has + Attribute [2/2]

  • [X] redefine has as a protocol so you can pass in other classes to use other than Doodle::Attribute

    has :thing, :using => MyClassAttribute

    I could then use this to define other specialised directives which use subclasses of Doodle::Attribute, e.g. Doodle::CommandLineOption

  • [X] refactor has to use specialized attribute classes for collections

Documentation [2/10]

  • [ ] better examples (and better running example)
  • [ ] more in tutorial fashion (cf. presentation) - from simple to more complex
  • [X] separate page for each feature?
  • [ ] tutorial?
  • [ ] use capture/xmpfilter to run code
    • [ ] and verify that output is correct
  • [X] use webby rather than rote (not supported anymore it seems)
  • [ ] document how to call factory functions defined in modules i.e. MyModule.Thing(:param => ‘abc’) rather than MyModule::Thing()
  • [ ] provide full example of before vs after
    • i.e. write out in full what you’d have to do to get same functionality
    • perhaps also using traits and fattr
  • [ ] example of using doodle to generate classes
    • (e.g. write out optimised Ruby code rather than use framework) i.e. I could use the information gathered to generate a source file
  • could also be in other language (e.g. Java, SQL DDL, etc.) (see SQL tables definition example)

Specs [0/6]

  • [ ] write spec for new #parents
  • [ ] Want specs for both flavours of use (e.g. class C < Doodle and include Doodle::Core)
    • so I’ll probably need to generate the specs from templates
  • [ ] reorganize specs around features
  • [ ] make sure singleton inheritance working also, make sure I know exactly how I want this to work :)
  • [ ] 1.9 review specs for 1.9 - seems like Object is getting updated somehow
  • [ ] 1.9 also check discarding inherited method

Fixes

fix messy code [1/4]

  • [X] parents
  • [ ] collect_inherited
    • this is pretty slow too
  • [ ] embrace - maybe replace?
    • perhaps use Ara Howard’s Mixin? Or similar

simplify usage

class Foo < Doodle end class Bar include Doodle::Core end

i.e. have a top-level class rather than

Fix errors collection [0/1]

  • [ ] document it (when working properly)

should be simpler way of getting to errors collection [0/0]

  • the errors collection is for collecting all errors on an instance rather than raising an exception on the first error
  • current way of collecting errors is not satisfactory
  • need to get clearer idea of desired interaction
  • errors need to be on the instance
  • should clear errors before validation (or perhaps on accessing?)
  • compare with AR
  • errors on attributes should be collected at the instance level
  • now not sure that Attributes should be Doodles - perhaps simpler

formalize content of errors collection [1/2]

  • [X] include attribute name
  • [ ] do I want to save the call stack? probably

Fixes [1/1]

  • compatibility with AR? do I need/want that?
  • [X] make raise exception on invalid values optional

Profile performance against plain old attributes [4/4]]

and compare with:

  • [X] attr_accessor
  • [X] attributes
  • [X] traits
  • [X] fattr

No surprise - doodle is much slower

Reorganize library layout to follow newgem

  • only because this seems to be emerging standard (but don't use web page generation)

Compatibility

check compatibility with ActiveRecord

  • may need to rename :attributes to :doodles or something similar to avoid name clash
    • changed #parent to #doodle_parent to avoid clash with ActiveSupport
  • or to access through __doodle__ method
  • also, validate! method, e

Sequel

  • doesn’t work with sequel_model at moment - conflict over initialization

compare with moose

Write proper pretty printer (to_doodle)

  • is this pointless? can I ever get full coverage?
  • need to know instance variables in same way as yaml, etc.
  • maybe could use yaml as intermediate representation?

Fix up half-assed features [1/1]

or get rid of them

  • [X] to_doodle - gone

Fix inspect [2/2]

  • [X] don’t include @__doodle__ in inspect string
  • [X] don’t break built-ins

Known bugs [3/3]

  • [X] loading from yaml should apply conversions 2008-03-24
  • [X] sort out duplication of errors when calling validate! after setting incorrect value has already generated entry 2008-03-26
  • [X] validate! sets instance variables with defaults

Need some way of accessing containing object from attribute

  • why?
    • to put errors on instance
  • though this is somewhat tricky - can’t use simple reference to parent as neither would be garbage collected (bkz of cycle - better check this)
  • 2008-04-06 22:12:22 use Doodle.parent (inside initialization only)
  • 2008-04-17 15:57:15 use #parent instead of Doodle.parent (doesn’t seem to affect memory usage)

Fix singleton & class init

  • I’m not happy using the class_init directive
  • may be better to treat singleton attributes differently, e.g. to interpret the init at definition time rather than on object initialization
  • the question then is how do you know you’re in a singleton? it seems to be one of those things that by checking to see if you are one, you become it
  • solution: done on first access
    • this isn’t perfect however

Add typedef methods (e.g. date :name, string :name, etc.)

  • [X] how should this be presented?
    • class level directives (at attr_accessor level)
    • [X] within block? to avoid too much namespace pollution
      • e.g. doodle do … end
  • see examples/datatypes.rb

Check memory usage

  • all those closures - are they leaking?
  • and DOODLES hash (are objects being finalised?)
  • check garbage collection of attributes
  • 2008-04-06 22:12:18 - used ruby-bleak-house - doesn’t look good :(
  • fixed - used @__doodle__ instead of DOODLES in DoodleInfo

New features [0/0]

  • add :match from doodle/app to core
    • apply before :from
    • or include in :from, e.g

      from String do |s| must “contain only digits” do |s| s =~ ^\d+$ end s.to_i end

      from String, :match => ^\d+$ do |s| s.to_i end

    • perhaps rename :pattern (after XMLSchema)
  • converge on XMLSchema (e.g. PositiveInteger)
  • ‘unions’ in collections, e.g. has :elements, :collect => [Element, Image, Text] has :elements, :collect => { :element => Element, :image => Image, :text => Text }
  • merge doodle/datatypes and doodle/app - rationalize
  • don’t make it awkward to use datatypes - if included, make available
  • make it easier to define datatype helpers
  • has_many instead of has :collect?
    • list_of
    • dict, map_of
  • type-safe collections (check type when adding to list - trickier than it seems)

reorganize todo.org list into ditz

move speculative stuff out of todo.org