[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Managing complexity and untangling my thoughts

Hal E. Fulton

4/21/2005 9:58:00 PM

Sometimes I stare at the monitor and think: Is it too late
to change majors?

I'm about to start a rewrite of Tycho in my <sarcasm>copious</sarcasm>
spare time.

For those curious about this tool, see
http://tycho.rub...
or the RubyConf slides at
http://rubyhacker.com/ty...

The basic paradigm is a hierarchy of categories, each consisting
of a pile of notes. But structuring the code in proper OO fashion
is nontrivial in my view.

I have spent much time scribbling on napkins and muttering MVC
jargon to myself, but to little avail. I'm confused and my
brain is itching.

As one of the slides indicates, part of my confusion is different
ways of thinking about what a "note" is.

Sometimes I perceive it as:
- an object of a certain class
- the actual text of the note
- the text plus its metadata
- the YAML'd version of the text+metadata
- the key used to look up the record in the db
- the text field in which the text is displayed
- the parent widget to which that text field belongs
- or something else.

I like the idea of composing an object of smaller objects --
for example, store all the GUI stuff in note.widget or
note.gui or something.

But then (among other complications) the note has a title
(note.title) which is also stored in the GUI (note.widget.title) --
these must be kept in sync. :/ And so on.

What are your mental (or other) tools for dealing with this sort
of complexity?


Thanks,
Hal




17 Answers

Joao Pedrosa

4/21/2005 11:01:00 PM

0

Hi,

> What are your mental (or other) tools for dealing with this sort
> of complexity?

I don't know about tools for this. But you could use "tagging" ala
GMail to avoid having to use hierarchies of categories. It should
simplify the GUI and the database. I would use an RDBMS instead of an
OODBMS as well.

I'm not sure about the use of YAML for this. Because a "notes table"
in the database could use detailed fields like "title", "message",
"post_date", etc. Maybe use YAML for the message only? :-)

I wouldn't worry about MVC because unless you can share a running
server for the different "Views", the data in an RDBMS is enough to
allow for as many different "Views" as the time brings.

It's interesting, but WikiWikis are awesome as well. Maybe you could
create a "Desktop interface" to the Hiki project:
http://sourceforge.jp/pro...

It uses the "file system" itself. :-) hehe

Cheers,
Joao



Francis Hwang

4/21/2005 11:35:00 PM

0

My recommendation would be fairly XP-ish: Don't worry about overall
structure as much as getting features out. Evolve your code as you
write it. Use lots of automated tests to make it safe for you to do
radical changes mid-stream.

Most of the time, we don't have the luxury of knowing exactly what kind
of software we want. And most of the time, getting to use it halfway
changes our understanding of the problem.

So don't plan ahead. It's too easy to get AnalysisParalysis that way.

On Apr 21, 2005, at 5:57 PM, Hal Fulton wrote:

> Sometimes I stare at the monitor and think: Is it too late
> to change majors?
>
> I'm about to start a rewrite of Tycho in my <sarcasm>copious</sarcasm>
> spare time.
>
> For those curious about this tool, see
> http://tycho.rub...
> or the RubyConf slides at
> http://rubyhacker.com/ty...
>
> The basic paradigm is a hierarchy of categories, each consisting
> of a pile of notes. But structuring the code in proper OO fashion
> is nontrivial in my view.
>
> I have spent much time scribbling on napkins and muttering MVC
> jargon to myself, but to little avail. I'm confused and my
> brain is itching.
>
> As one of the slides indicates, part of my confusion is different
> ways of thinking about what a "note" is.
>
> Sometimes I perceive it as:
> - an object of a certain class
> - the actual text of the note
> - the text plus its metadata
> - the YAML'd version of the text+metadata
> - the key used to look up the record in the db
> - the text field in which the text is displayed
> - the parent widget to which that text field belongs
> - or something else.
>
> I like the idea of composing an object of smaller objects --
> for example, store all the GUI stuff in note.widget or
> note.gui or something.
>
> But then (among other complications) the note has a title
> (note.title) which is also stored in the GUI (note.widget.title) --
> these must be kept in sync. :/ And so on.
>
> What are your mental (or other) tools for dealing with this sort
> of complexity?
>
>
> Thanks,
> Hal
>
>
>
>

Francis Hwang
http://f...



Assaph Mehr

4/21/2005 11:54:00 PM

0


Hal Fulton wrote:
> As one of the slides indicates, part of my confusion is different
> ways of thinking about what a "note" is.
[snip]
> What are your mental (or other) tools for dealing with this sort
> of complexity?

Duck typing :-)
If you do employ MVC the the data-centric note is not concerned with
the view-centric note. That's one thing less to worry about.
So how about a data-centric note that duck types to the appropriate
usage? e.g. #to_str, #to_yaml, #properties, #key etc. Then have the
view-centric note just reference (and delegate to) the data note.

But as stated by others - Make It Work before you Make It Right. You
might change your requirements, your understanding of the problem etc.
For example, you have a static category tree where notes are filed. As
my grad project, myself and another student made a bookmark sharing
application. Each bookmark had categories, but each user built his own
tree of categories for display...
Which creates a problem or the UI but actually simplifies the data
model.

HTH,
Assaph

John-Mason P. Shackelford

4/22/2005 4:22:00 AM

0


> Sometimes I stare at the monitor and think: Is it too late
> to change majors?

Me too :)

> Make It Work before you Make It Right.

But it sounds like Hal already has it working and is now trying to make
it right. Refactoring to patterns is part of XP development lifecycle,
but sometimes knowing where to begin what will be large refactoring is
tricky. It certainly pays to be incremental, but that still calls for
design.

Not a tool, but a personal coping technique: I find reading source for
the Eclipse project stretching and a valuable source of practical
software pattern solutions to complex problems. Some of the brightest
software developers of our era work on the project and it is a mine rich
with insight.

Other worthwhile coping mechanisms include sleep, a shower, etc. :)

> But then (among other complications) the note has a title
> (note.title) which is also stored in the GUI (note.widget.title) --
> these must be kept in sync. :/

Unless your widget simply renders (or adapts) the model, then there is
no duplication and nothing to keep in sync.


John-Mason Shackelford

Software Developer
Pearson Educational Measurement

2510 North Dodge St.
Iowa City, IA 52245
ph. 319-354-9200x6214
john-mason.shackelford@pearson.com
http://pearsonedmeasu...




Robert Klemme

4/22/2005 1:48:00 PM

0



"Hal Fulton" <hal9000@hypermetrics.com> schrieb im Newsbeitrag
news:426821C2.3040705@hypermetrics.com...
> Sometimes I stare at the monitor and think: Is it too late
> to change majors?
>
> I'm about to start a rewrite of Tycho in my <sarcasm>copious</sarcasm>
> spare time.
>
> For those curious about this tool, see
> http://tycho.rub...
> or the RubyConf slides at
> http://rubyhacker.com/ty...
>
> The basic paradigm is a hierarchy of categories, each consisting
> of a pile of notes. But structuring the code in proper OO fashion
> is nontrivial in my view.
>
> I have spent much time scribbling on napkins and muttering MVC
> jargon to myself, but to little avail. I'm confused and my
> brain is itching.
>
> As one of the slides indicates, part of my confusion is different
> ways of thinking about what a "note" is.
>
> Sometimes I perceive it as:
> - an object of a certain class
> - the actual text of the note
> - the text plus its metadata
> - the YAML'd version of the text+metadata
> - the key used to look up the record in the db
> - the text field in which the text is displayed
> - the parent widget to which that text field belongs
> - or something else.
>
> I like the idea of composing an object of smaller objects --
> for example, store all the GUI stuff in note.widget or
> note.gui or something.
>
> But then (among other complications) the note has a title
> (note.title) which is also stored in the GUI (note.widget.title) --
> these must be kept in sync. :/ And so on.
>
> What are your mental (or other) tools for dealing with this sort
> of complexity?

I'm sorry, I don't have the time to look deeper into this ATM. But one
thing about your post strikes me as odd: you mention "note.widget". This
sounds to me as if the model (note) contains view components (widget). I
think usually it's the other way round: the widget knows the model but the
model doesn't know anything about representation. So it would rather be
"note_widget.note" and this would also remove your problem with the title
synch: "note_widget.title" would look like this "class NoteWidgeg; def
title() note.title end end" (you probably could use delegation for this).

Just my 0.02 EUR....

Kind regards

robert

Dema

4/22/2005 2:02:00 PM

0


I've read in the presentation that you're using YAML as a internal data
representation, including metadata.

I would definately recommend you to consider using a RDF model for that
(like Thunderbird and Firefox does). It would give you interoperable
capabilites and also a more flexible data model, and in the near
future, rules-based inferencing and more powerful searching.

My 0.02c

Demetrius

Hal E. Fulton

4/22/2005 2:22:00 PM

0

Robert Klemme wrote:
>
> I'm sorry, I don't have the time to look deeper into this ATM. But one
> thing about your post strikes me as odd: you mention "note.widget". This
> sounds to me as if the model (note) contains view components (widget). I
> think usually it's the other way round: the widget knows the model but the
> model doesn't know anything about representation. So it would rather be
> "note_widget.note" and this would also remove your problem with the title
> synch: "note_widget.title" would look like this "class NoteWidgeg; def
> title() note.title end end" (you probably could use delegation for this).
>

I'm sure this makes sense. My original code was not written from an MVC
perspective.


Hal



Hal E. Fulton

4/22/2005 2:25:00 PM

0

Dema wrote:
> I've read in the presentation that you're using YAML as a internal data
> representation, including metadata.
>
> I would definately recommend you to consider using a RDF model for that
> (like Thunderbird and Firefox does). It would give you interoperable
> capabilites and also a more flexible data model, and in the near
> future, rules-based inferencing and more powerful searching.

I had planned to write helper code to export trees to XML and other forms.

I'm ignorant of RDF. Can you explain the benefits in a little more
detail?


Thanks,
Hal



Petite Abeille

4/22/2005 2:34:00 PM

0


On Apr 22, 2005, at 16:25, Hal Fulton wrote:

> I had planned to write helper code to export trees to XML and other
> forms.
>
> I'm ignorant of RDF. Can you explain the benefits in a little more
> detail?

SEMANTIC KNIGHT:
None shall pass without formally defining the ontological
meta-semantic thingies of their domain something-or-others!

HACKER:
What?

http://lists.xml.org/archives/xml-dev/200504/msg...

Cheers

--
PA, Onnay Equitursay
http://alt.text...



Gavin Kistner

4/23/2005 4:29:00 PM

0

On Apr 22, 2005, at 8:33 AM, PA wrote:
> SEMANTIC KNIGHT:
> None shall pass without formally defining the ontological
> meta-semantic thingies of their domain something-or-others!
>
> HACKER:
> What?
>
> http://lists.xml.org/archives/xml-dev/200504/msg...

LOL!
Thanks for sharing that. I didn't realize that was how I felt until I
saw it so aptly put. :)


--
(-, /\ \/ / /\/