You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Jean-Sebastien Delfino <js...@apache.org> on 2011/05/11 07:19:33 UTC

Drawing composite graphs, was: [jira] [Commented] (TUSCANY-3496) Develop a simple tool that can be used to generate composite diagrams from the xml files

On Sun, May 8, 2011 at 10:21 AM, C.S. Nirmal J. Fernando (JIRA)
<de...@tuscany.apache.org> wrote:
>
>    [ https://issues.apache.org/jira/browse/TUSCANY-3496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030511#comment-13030511 ]
>
> C.S. Nirmal J. Fernando commented on TUSCANY-3496:
> --------------------------------------------------
>
> Hi,
>
> I'm looking at Graphviz API, playing around it and checking whether it can be used in this project !
> Also watching few screen casts, reading the paper "Drawing graphs with dot" by Emden Gansner and Eleftherios Koutsofios and Stephen North to learn "dot language", and experimenting :)
>

Sounds good.

I think it'd be interesting to try to generate the same diagram using
Batik, Graphviz, and 'nothing' (just print SVG directly in your code),
and then compare the three programs. There may be other options out
there too, but I'm suggesting to try the 'nothing' approach, as in my
experience SVG is easy enough to print without a complex object model
like Batik's.

-- 
Jean-Sebastien

Re: Drawing composite graphs, was: [jira] [Commented] (TUSCANY-3496) Develop a simple tool that can be used to generate composite diagrams from the xml files

Posted by Nirmal Fernando <ni...@gmail.com>.
On Mon, Jun 13, 2011 at 1:16 PM, Jean-Sebastien Delfino <
jsdelfino@apache.org> wrote:

> On Wed, May 25, 2011 at 6:19 AM, Nirmal Fernando <ni...@gmail.com>
> wrote:
> > Hi Jean,
> >
> > Please see my comments in line.
> >
> >>
> >> Another way to ask the question is: What if you spend time to master
> >> Graphviz (1.6Mb) and Batik (1657 classes, 8Mb) and build something
> >> nice with them, and then somebody else just tries without these big
> >> dependencies, at the expense of some hard (but interesting) work to
> >> craft and tune the necessary algorithms, and produces a similar result
> >> with a few pages of lightweight code? Which one will be more
> >> successful?
> >
> > Reusing is good other than building one from scratch not knowing what
> will
> > be the outcome, don't you think?
>
> Sorry for the delay, I've been really busy recently. In a way it's
> good that I didn't reply too quickly as that allowed you to figure
> part of the answer yourself :) and I see that you've given up on
> Graphviz after running into some limitations.
>

No problem! :)

>
> I think my main observation is reusing software requires to evaluate:
> a) the useful function provided by that software that'll help you;
> b) its baggage, limitations, bugs, operational constraints that'll get
> in your way;
> c) the effort to understand how to use it to your advantage;
> d) the effort to adapt and glue it to the pile of other software
> you've decided to reuse.
>
> ... and put that in balance with:
> e) not reusing that useful function;
> f) but spend the effort you'd had spent to (b), (c) and (d) on writing
> the exact function you need.
>
> Often people only look at (a) and then struggle with (b), (c), (d). I
> think this is a problem in particular on the Java platform, where the
> development community is very quick to reuse giant piles of code just
> because they're available, without measuring all the implications (as
> opposed to C or C++ where developers tend to think more before making
> a move, or Python for example where libraries are typically smaller or
> much easier to re-implement).
>

Thanks for the explanation!

>
> I looked at the code you've started to commit in the collaboration
> area. Looks like a good start to (f) -- spend quality time to
> implement the algorithm you need :).


I started on layout algorithm and send a progress diagram to the dev list,
hope you saw it!


> I have a few review comments:
>
> - it's good that you have Apache license headers in some files, would
> be even better to have them in all the files;
>

Just now committed! :)

>
> - a few more comments in the code will help others in the community
> review and understand your code, and perhaps even come and help you;
>

Added few, but will add more in coming days!

>
> - a Maven build and automated JUnit test cases will help you and
> others exercise your code and verify that it works.
>

I will try to provide them as soon as possible!

Thanks.

>
> --
> Jean-Sebastien
>



-- 
Best Regards,
Nirmal

C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.

Blog: http://nirmalfdo.blogspot.com/

Re: Drawing composite graphs, was: [jira] [Commented] (TUSCANY-3496) Develop a simple tool that can be used to generate composite diagrams from the xml files

Posted by Jean-Sebastien Delfino <js...@apache.org>.
On Wed, May 25, 2011 at 6:19 AM, Nirmal Fernando <ni...@gmail.com> wrote:
> Hi Jean,
>
> Please see my comments in line.
>
>>
>> Another way to ask the question is: What if you spend time to master
>> Graphviz (1.6Mb) and Batik (1657 classes, 8Mb) and build something
>> nice with them, and then somebody else just tries without these big
>> dependencies, at the expense of some hard (but interesting) work to
>> craft and tune the necessary algorithms, and produces a similar result
>> with a few pages of lightweight code? Which one will be more
>> successful?
>
> Reusing is good other than building one from scratch not knowing what will
> be the outcome, don't you think?

Sorry for the delay, I've been really busy recently. In a way it's
good that I didn't reply too quickly as that allowed you to figure
part of the answer yourself :) and I see that you've given up on
Graphviz after running into some limitations.

I think my main observation is reusing software requires to evaluate:
a) the useful function provided by that software that'll help you;
b) its baggage, limitations, bugs, operational constraints that'll get
in your way;
c) the effort to understand how to use it to your advantage;
d) the effort to adapt and glue it to the pile of other software
you've decided to reuse.

... and put that in balance with:
e) not reusing that useful function;
f) but spend the effort you'd had spent to (b), (c) and (d) on writing
the exact function you need.

Often people only look at (a) and then struggle with (b), (c), (d). I
think this is a problem in particular on the Java platform, where the
development community is very quick to reuse giant piles of code just
because they're available, without measuring all the implications (as
opposed to C or C++ where developers tend to think more before making
a move, or Python for example where libraries are typically smaller or
much easier to re-implement).

I looked at the code you've started to commit in the collaboration
area. Looks like a good start to (f) -- spend quality time to
implement the algorithm you need :). I have a few review comments:

- it's good that you have Apache license headers in some files, would
be even better to have them in all the files;

- a few more comments in the code will help others in the community
review and understand your code, and perhaps even come and help you;

- a Maven build and automated JUnit test cases will help you and
others exercise your code and verify that it works.

-- 
Jean-Sebastien

Re: Drawing composite graphs, was: [jira] [Commented] (TUSCANY-3496) Develop a simple tool that can be used to generate composite diagrams from the xml files

Posted by Nirmal Fernando <ni...@gmail.com>.
Hi Jean,

Please see my comments in line.

On Mon, May 23, 2011 at 8:48 AM, Jean-Sebastien Delfino <
jsdelfino@apache.org> wrote:

> On Wed, May 11, 2011 at 9:02 AM, Nirmal Fernando <ni...@gmail.com>
> wrote:
> > Hi Jean,
> >
> > On Wed, May 11, 2011 at 10:49 AM, Jean-Sebastien Delfino
> > <js...@apache.org> wrote:
> >>
> >> On Sun, May 8, 2011 at 10:21 AM, C.S. Nirmal J. Fernando (JIRA)
> >> <de...@tuscany.apache.org> wrote:
> >> >
> >> >    [
> >> >
> https://issues.apache.org/jira/browse/TUSCANY-3496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030511#comment-13030511
> >> > ]
> >> >
> >> > C.S. Nirmal J. Fernando commented on TUSCANY-3496:
> >> > --------------------------------------------------
> >> >
> >> > Hi,
> >> >
> >> > I'm looking at Graphviz API, playing around it and checking whether it
> >> > can be used in this project !
> >> > Also watching few screen casts, reading the paper "Drawing graphs with
> >> > dot" by Emden Gansner and Eleftherios Koutsofios and Stephen North to
> learn
> >> > "dot language", and experimenting :)
> >> >
> >>
> >> Sounds good.
> >>
> >> I think it'd be interesting to try to generate the same diagram using
> >> Batik, Graphviz, and 'nothing' (just print SVG directly in your code),
> >> and then compare the three programs. There may be other options out
> >> there too, but I'm suggesting to try the 'nothing' approach, as in my
> >> experience SVG is easy enough to print without a complex object model
> >> like Batik's.
> >
> > Don't you think that 'nothing' approach would need some significant work
> on
> > finding/implementing a
> > layout building algorithm? If Graphviz implementation succeed, I am not
> sure
> > whether it is worth to put an effort on 'nothing' approach.
> >
> > What do you think?
> >
> > Thanks.
>
> I think the best way to know is to try. I didn't mean spending a lot
> of time investigating the 'nothing' approach. Just enough to decide if
> it's worth doing, or if it can be eliminated without a doubt... but
> based on concrete data.
>
> I think there's different aspects in what you're trying to do:
> a) walk an SCDL model and transforming it to a model from which you
> can derive a layout easily
> b) compute the layout of the composite diagram
> c) generate SVG for that layout
> d) allow a user to navigate it, zoom etc
>
> My guess is that Graphviz and Batik won't help with (a), may help with
> (b), are probably over complicated for (c), and I don't know if they
> can help or instead get in the way for (d).
>

I am experimenting with graphViz and it appears to be used for our tool.
Will update you soon, about my conclusions on using graphViz.


> The 'nothing' approach wouldn't change the situation for (a), would
> require you to think hard and craft some algorithms for (b), and
> wouldn't get in your way for (c) and (d).
>

True, depending on how graphViz reacts this approach will be considered.


>
> Another way to ask the question is: What if you spend time to master
> Graphviz (1.6Mb) and Batik (1657 classes, 8Mb) and build something
> nice with them, and then somebody else just tries without these big
> dependencies, at the expense of some hard (but interesting) work to
> craft and tune the necessary algorithms, and produces a similar result
> with a few pages of lightweight code? Which one will be more
> successful?
>

Reusing is good other than building one from scratch not knowing what will
be the outcome,
don't you think?


> But again we won't know if that's possible without trying... If you're
> already comfortable with Graphviz and Batik, I don't want to derail
> your progress, it's really up to you to decide which way you prefer to
> go here :)


Thanks, I will update on how my journey with GraphViz goes. :)


> Thoughts?
> --
> Jean-Sebastien
>



-- 
Best Regards,
Nirmal

C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.

Blog: http://nirmalfdo.blogspot.com/

Re: Drawing composite graphs, was: [jira] [Commented] (TUSCANY-3496) Develop a simple tool that can be used to generate composite diagrams from the xml files

Posted by Jean-Sebastien Delfino <js...@apache.org>.
On Wed, May 11, 2011 at 9:02 AM, Nirmal Fernando <ni...@gmail.com> wrote:
> Hi Jean,
>
> On Wed, May 11, 2011 at 10:49 AM, Jean-Sebastien Delfino
> <js...@apache.org> wrote:
>>
>> On Sun, May 8, 2011 at 10:21 AM, C.S. Nirmal J. Fernando (JIRA)
>> <de...@tuscany.apache.org> wrote:
>> >
>> >    [
>> > https://issues.apache.org/jira/browse/TUSCANY-3496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030511#comment-13030511
>> > ]
>> >
>> > C.S. Nirmal J. Fernando commented on TUSCANY-3496:
>> > --------------------------------------------------
>> >
>> > Hi,
>> >
>> > I'm looking at Graphviz API, playing around it and checking whether it
>> > can be used in this project !
>> > Also watching few screen casts, reading the paper "Drawing graphs with
>> > dot" by Emden Gansner and Eleftherios Koutsofios and Stephen North to learn
>> > "dot language", and experimenting :)
>> >
>>
>> Sounds good.
>>
>> I think it'd be interesting to try to generate the same diagram using
>> Batik, Graphviz, and 'nothing' (just print SVG directly in your code),
>> and then compare the three programs. There may be other options out
>> there too, but I'm suggesting to try the 'nothing' approach, as in my
>> experience SVG is easy enough to print without a complex object model
>> like Batik's.
>
> Don't you think that 'nothing' approach would need some significant work on
> finding/implementing a
> layout building algorithm? If Graphviz implementation succeed, I am not sure
> whether it is worth to put an effort on 'nothing' approach.
>
> What do you think?
>
> Thanks.

I think the best way to know is to try. I didn't mean spending a lot
of time investigating the 'nothing' approach. Just enough to decide if
it's worth doing, or if it can be eliminated without a doubt... but
based on concrete data.

I think there's different aspects in what you're trying to do:
a) walk an SCDL model and transforming it to a model from which you
can derive a layout easily
b) compute the layout of the composite diagram
c) generate SVG for that layout
d) allow a user to navigate it, zoom etc

My guess is that Graphviz and Batik won't help with (a), may help with
(b), are probably over complicated for (c), and I don't know if they
can help or instead get in the way for (d).

The 'nothing' approach wouldn't change the situation for (a), would
require you to think hard and craft some algorithms for (b), and
wouldn't get in your way for (c) and (d).

Another way to ask the question is: What if you spend time to master
Graphviz (1.6Mb) and Batik (1657 classes, 8Mb) and build something
nice with them, and then somebody else just tries without these big
dependencies, at the expense of some hard (but interesting) work to
craft and tune the necessary algorithms, and produces a similar result
with a few pages of lightweight code? Which one will be more
successful?

But again we won't know if that's possible without trying... If you're
already comfortable with Graphviz and Batik, I don't want to derail
your progress, it's really up to you to decide which way you prefer to
go here :)

Thoughts?
-- 
Jean-Sebastien

Re: Drawing composite graphs, was: [jira] [Commented] (TUSCANY-3496) Develop a simple tool that can be used to generate composite diagrams from the xml files

Posted by Nirmal Fernando <ni...@gmail.com>.
Hi Jean,

On Wed, May 11, 2011 at 10:49 AM, Jean-Sebastien Delfino <
jsdelfino@apache.org> wrote:

> On Sun, May 8, 2011 at 10:21 AM, C.S. Nirmal J. Fernando (JIRA)
> <de...@tuscany.apache.org> wrote:
> >
> >    [
> https://issues.apache.org/jira/browse/TUSCANY-3496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030511#comment-13030511]
> >
> > C.S. Nirmal J. Fernando commented on TUSCANY-3496:
> > --------------------------------------------------
> >
> > Hi,
> >
> > I'm looking at Graphviz API, playing around it and checking whether it
> can be used in this project !
> > Also watching few screen casts, reading the paper "Drawing graphs with
> dot" by Emden Gansner and Eleftherios Koutsofios and Stephen North to learn
> "dot language", and experimenting :)
> >
>
> Sounds good.
>
> I think it'd be interesting to try to generate the same diagram using
> Batik, Graphviz, and 'nothing' (just print SVG directly in your code),
> and then compare the three programs. There may be other options out
> there too, but I'm suggesting to try the 'nothing' approach, as in my
> experience SVG is easy enough to print without a complex object model
> like Batik's.
>

Don't you think that 'nothing' approach would need some significant work on
finding/implementing a
layout building algorithm? If Graphviz implementation succeed, I am not sure
whether it is worth to put
an effort on 'nothing' approach.

What do you think?

Thanks.


> --
> Jean-Sebastien
>



-- 
Best Regards,
Nirmal

C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.

Blog: http://nirmalfdo.blogspot.com/