Best working hours model to use with Bindings

  • Hi there-

    In my scheduling app I need to be able to let the user specify the
    working hours for individual workstations and the plant generally and
    I want to make sure it is a good model to use with Bindings.

    I have done a little testing with a CalendarDay class that has a BOOL
    iVar for each hour of the day (I just need hour resolution and 2
    choices--working or not working for each hour). I got to hour 3 and
    realized there must be a better way, although this way of doing it
    did work just fine with my Bindings test, using an NSMatrix of
    NSButtonCell checkboxes.

    But so many accessor methods to fully implement it! (48)

    So I think maybe I should make a class CalendarHour then I could have
    an array of 24 of them in each CalendarDay object. I can put 7
    CalendarDay objects into a CalendarWeek object and that would do it.

    But I am unable to think of a way to be able to make this work with
    Bindings using my preferred user interface of a grid of 24 hours x 7
    days.

    Non-optimal direction:
    I can imagine I could have a table of the 7 days, then I could select
    the desired day, and bind to the selection to work on 24 checkboxes
    at a time...but then even if I wanted to do this how then do I get
    "down to" the level of the CalendarHour objects?

    Can anyone give me a direction that would let me have my 24x7 grid
    bound to my CalendarWeek "root" object?

    Thank you
  • On 20 Oct 2007, at 11:49 PM, Paul Bruneau wrote:

    > In my scheduling app I need to be able to let the user specify the
    > working hours for individual workstations and the plant generally
    > and I want to make sure it is a good model to use with Bindings.
    >
    > I have done a little testing with a CalendarDay class that has a
    > BOOL iVar for each hour of the day (I just need hour resolution and
    > 2 choices--working or not working for each hour). I got to hour 3
    > and realized there must be a better way, although this way of doing
    > it did work just fine with my Bindings test, using an NSMatrix of
    > NSButtonCell checkboxes.
    >
    > But so many accessor methods to fully implement it! (48)

    Bindings haven't obsoleted data-source methods for every purpose. In
    your situation, I wouldn't use bindings.

    — F
  • On Oct 21, 2007, at 9:58 AM, Fritz Anderson wrote:

    > On 20 Oct 2007, at 11:49 PM, Paul Bruneau wrote:
    >
    >> In my scheduling app I need to be able to let the user specify the
    >> working hours for individual workstations and the plant generally
    >> and I want to make sure it is a good model to use with Bindings.
    >>
    >> I have done a little testing with a CalendarDay class that has a
    >> BOOL iVar for each hour of the day (I just need hour resolution
    >> and 2 choices--working or not working for each hour). I got to
    >> hour 3 and realized there must be a better way, although this way
    >> of doing it did work just fine with my Bindings test, using an
    >> NSMatrix of NSButtonCell checkboxes.
    >>
    >> But so many accessor methods to fully implement it! (48)
    >
    > Bindings haven't obsoleted data-source methods for every purpose.
    > In your situation, I wouldn't use bindings.

    Before completely tossing out bindings, I would first look into if a
    custom binding may be worth it.  I have written custom bindings for
    matrix subclasses and they've been very useful.  For example, I have
    a 'multiplication table' switch group (single control; one cell per
    table).  It has a single 'selectedTables' binding.

    Note that I'm not saying to always use bindings.  In some cases, the
    amount of code and/or complexity to set things up may be more than a
    non-bindings solution.

    ___________________________________________________________
    Ricky A. Sharp        mailto:<rsharp...>
    Instant Interactive(tm)  http://www.instantinteractive.com
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today