SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Itai Bar-Haim

  • Help Needed

    Hi everyone.

    I haven't been around for a long while, and also didn't commit any updates to the Class Diagram addin. This is because work was keeping me too busy and tired, and all kind of other projects kept coming in.

    Anyway, the 3.0 version of SharpDevelop is on its way, and it is time to get back to work and complete this addin for good :)

    However, I still can't find the time to do it... so I need your help :)

    Following is a list of tasks that need to be done to complete the set of addins. If you want to help with some of them (please do... ;)) just pick one and start coding. You can then send me patches for review, and I'll commit them (or, if you have commit permissions, you can commit them on your own, but I'd still like to be notified about it so I can review it).

    The tasks are:

    • Layout and Routing - the layout algorithm I wrote is a very simple one, somewhat buggy. Could be nice replacing it with something well known and commonly used. I actually wanted to use a free library for that, but couldn't find one that is free or that have a license we can use. About the routing algorithm - well, it sucks. Need to write something real. Again, library, free, license, yada yada... This task would probably not be something I'll work on, as I don't know the algorithms for that (nor had any luck finding them on the net), so if you happen to have a degree in graph-sciences or something, this could be the task for you.
    • Bug: Inner-Classes Resize - Something is not working there, and I couldn't track it down. It actually got me to a situation I started to look for other canvases and try to write new canvases just to have it replaced with something that always work. Just create some class and put several inner classes/structs/enums and play with it for a while, resizing, clicking the expand/collapse buttons, etc.
    • Class Editor - Well, just complete anything that seem to be missing in there. Should be straight-forward identifying that something is missing and implementing it. I'll try to add a more detailed list later on.
    • Class Wizards - Need to complete the current two (class wizard/interface wizard), and perhaps write some more (Enum wizard, for example). Then try to create an entire project's outline just with the wizards and see if it's easy enough and comfortable.

    That's about it. Any questions are welcome, and I'll make sure to check my inbox here regularly.

    Thanks for the help,
    Itai.

  • Generics... why so incomplete?

    Hi all.

    In this blog post I am going to whine a lot about the missing features of generics, that make the coders miserable.

    Generally, there is one repeating case that's giving me the hard time: Passing generic-based collections.

    Lets look at the following example:

     
    class Circle : Shape { ... } 

    void foo (IEnumerable<Shape> shapes)  { ... }

    void bar ()
    {
        foo (new List<Circle>());
    }
     

    You get a compilation error for that one. I can't understand why. Logically, if a Circle is a Shape and a List is an IEnumerable, than a List of Circles is an Enumeration of Shapes! Why is it wrong?

    Another example occure when using the 'where' clause:

    class ShapesHandler<T> where T : Shape
    {
        void foo(params T[] shapes) { ... }

        void bar ()
        {
            List<Shape> someShapes = new List<Shape>();
            foo (someShapes.ToArray());
        }
    }

    This also yields a compilation error. And of course the same goes if I had an array of Circles that I wanted to cast to an array of Shapes. The same error.

    Again, I cannot understand why; If the class ShapesHandler specifically defines that it can take any class type that is a Shape, why can't I pass in an array of shapes where ever an array of T is needed, and why can't I cast an array of T to an array of Shapes?

    (If you have a reasonable explanation, I would be glad to hear it. So far I only got the pretty lame explanation of 'this is a different type, this is how the compiler works' which is really unacceptable by me as it only describes the problem in a different words)

    Itai. 

  • Class Diagram Status

    Well, free time was a bit of a problem lately, and so the work on the class diagram was a bit slow.

    The main issue I addressed is compatibility with the Visual Studio 2005 class diagram file format. Currently the basics are implemented and seem to be working correctly. Another issue was Nested Types support. This is mostly working, not perfectly, however, as interacting with the nested types blocks doesn't work well at all. Still, it looks nice (and now it looks much more like the VS2005 theme, except for the full use of vector graphics :))

     

    The To-Do list is still quite long, though. In the BUGS sections, we can find the layout system, that yields bogus results for some reasons I cannot understand, and that even before the really special layouting need to be done (currently only the simplest tree layout is planned. Note that since the layout engine treats each block the way it is presented at the moment, this would allow automatic ordering of diagram for expanded blocks, which is better than what VS2005 does... I found it somewhat frustrating that it closes all blocks before performing layout). Also in the BUGS, need to fix the interactivity issue of the nested classes, and check why the main expand/collapse button is bigger than the text in its line.

    In the TO-COMPLETE section we can find the routing mechanism, currently offering no interactivity at all, and makes very bad routs, intersecting heavily with the class blocks. Also in that section there is the interfaces lollipop, currently drawn very statically. This need to be changed, so the user can collapse it, and place it (almost) anywhere around the class block as he/she wants.

    In the STILL-WAITING section there's the other part of the routing system - associations. Once the routing system works, this would be an easy task. Another thing that comes here is making the displayed items (members, methods, etc.) interactive (i.e. selectable, renamable, perhaps put up an on-diagram complete editing system, but this is a thought for the far future).

    Note this is only a partial list, including only the DIAGRAM part of the class diagram addin complex (the other parts include the class editor and the class wizard, that allows quick, visual editing of the project class structure).

    I would appreciate some help in here. I intentionally divided the work to several project, each is separate in its meaning. The Diagrams project is the basic layout and routing system, and includes all the drawing abilities. This can be used for other things as well, if you want to add a feature that requires drawing. I am thinking of moving the interactive parts in there as well, making it some kind of a tool-kit for graphical diagrams. Anyway, if you want to use it, and/or give me a hand, just leave me a note.

    That's is until next time.

    Itai.
     

  • Class Editor Progress Report

    Well, I took some time this weekend to continue the class editor, which is the most dynamic part of the class diagram addin. The class editor allows you to visually modify a class, by displaying its various elements in a simple grid-like display:

     

    The main challenge in writing the class editor is the massive refactoring code that should be placed in. Almost every operation (actually, every editing operation) done with the class editor causes changes in the program code. Some changes might be as simple as member renaming, others are more complex, such as method signature changes.

    Currently I've got the member global renaming and parameter global renaming working. Local renaming (the specific occurance of the member or parameter) isn't coded yet, and that is the case for all types of method signature modifications. Note that the refactoring mechanism of Sharp Develop does not currently support such modifications, so this is going to be a bigger task to handle, and I will actually could use some major help with this task, so please contact me if you can and want to help.

    Well, that's it for now, more to come later :-)
    Itai.

  • The Class Diagram Addin and its Surroundings

    SharpDevelop is the program I use at home for all my .Net coding. At work I've used Visual Studio for the last couple of months, but I'm coming from a Linux background, and used mostly GVIM as my editor, that is the most common editor where I work (Some say sadly...)

    As you can see, I've experienced  both low level tools and high level tools. I started using SharpDevelop because, like most people, I prefer the high level tools (the IDEs) and SharpDevelop was there and was free (recently Microsoft released Visual Studio Express, but it takes forever to install and takes about 1.5 GB, for nothing more than any other IDE would give).

    After a while working with  SharpDevelop, I started to feel that some things could be made better. As my work title is a software architect, I many times start my coding work in the Class Diagram view, drafting the architecture visually. This feature was missing for me in SharpDevelop. So I thought, why wouldn't I write an addin?

    I started working on my addin by looking for explanation and a starting point. I found the wonderful tutorial and video in the wiki, and started implementing. A couple of refactoring phases made the addin architecture nicer (note that it is not yet complete) and many elements were made reusable.

    During the creation of the addin I found that some features I want to use from within the addin are also missing from SharpDevelop:

    • Class Editor
    • Class Wizard

    The class editor is a fairly big feature allowing the editing of the class structure from a simple tree-grid-view, showing the hierarchy of the class (class->members->parameters) and allowing to add and remove members and parameters, while the code is changing accordingly.

    The class wizard is a simple code generator, that asks you to fill in some information about your class, like its name, the class from which it inherits, the interfaces it implements, etc... and it creates the code for you and add it to the project. A good class wizard allows you to fill in the bare minimum of required information manually, and creates the class respectively. The idea is that the class can and will be modified later on by the class diagram.

    Currently the class diagram is working fairly with quite some bugs (like layout) and missing features (like editing). The class editor does not allow editing at the moment and the class wizard is in its early stages, although today I managed to use it to create a new class in my project.

    Well, I'll keep writing (the addin and in the blog), and I hope to get things done soon.

    See you next time,

    Itai.
     

Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.