[MonoDevelop] Online Templates

Sanjoy Das sanjoy at playingwithpointers.com
Tue Mar 23 05:17:18 EDT 2010


Hi!

I was actually thinking of working on this project for my GSoC. I
already have a rough draft of my proposal which I've attached. Would be
great if you could take some time out and give me a suggestion or two.
Did not paste it inline because all the line breaks were screwing up.

-- 
Regards,

Sanjoy Das
http://playingwithpointers.com
http://playingwithpointers.com/custom/public_key.txt
-------------- next part --------------
IMPLEMENTING ONLINE TEMPLATES IN MONODEVELOP
============================================

	Sanjoy Das (sanjoy at playingwithpointers.com)

Objective & Final Deliverables
------------------------------

A template, unless otherwise specified, refers to both file and project
templates.

The final deliverables viz. the products produced at the end of the project
cycle shall consist of the following:

 * An addin based framework that shall allow the user to add custom template
   sources.
    - An addin which implements the interface should be able to act as a source
      of templates.
    - Multiple sources show up different categories in the 'New File' or the
      'New Project' dialog.

 * Implementations of the above for
    - A template source which fetches templates from across the internet
       > From regular HTTP sources.
       > From HTTPS sources, with proper authentication.
    - A template source which fetches templates from a subversion repository. I
      plan on using SharpSVN for this.
     
 * A basic Django-based repository with the following features.
    - Users register, log-in and submit templates. Expose an interface which
      allows users to manually upload template files as well as allow the IDE to
      POST template files directly to the service with authentication. They are
      allowed to tag the templates they upload with a name, a short description
      and a few keywords.
    - Peers review templates and rate them, preferably exposing an interface to
      set the ratings from the web interface as well as from within the IDE.
    - Download (list and search) the currently available templates.
    - Allow a few administrators to be able to moderate the templates.

 * An addin based framework which allows the creation of project / file
   wizards. Wizards show up in their own subcategory in the 'New File/Project'
   dialogs.

 * A wizard which allows to essentially create a template out of an existing
   project or file and upload it to the web service.


Basic Implementation Roadmap
----------------------------

The entire implementation shall (understandably) revolve around the MonoDevelop
addin framework. Templates shall be represented with data structures with
hierarchy similar to the following -

 * ITemplate
    * IProjectTemplate
       * XmlProjectTemplate -> Associated with an XML definition file.
       * IProjectWizard     -> Dynamic in nature.
    * IFileTemplate
       * XmlFileTemplate    -> Associated with an XML definition file.
       * IFileWizard        -> Dynamic in nature.

IFileWizards and IProjectWizards are addin interfaces and addins implementing them
and hooking onto a predefined extension point are shown in the wizards category
in the New Project/File dialogs.

All these interfaces shall have certain some methods common, which we will call
to, say, initialize the template and to, say, instantiate the project or file
from the template. Parameters shall be passed to these methods based on what the
user enters in the New dialog. The project path shall be passed, for instance.

The Xml* classes might choose to silently create the project, while the *Wizard
implementors will possibly (while creating the project) pop-up some kind of
GUI to prompt for whatever user input the creator of the wizard had in mind.

The template sources shall also be implemented as addins, with a hierarchy like
the following - 

 * ITemplateSource
   * WebTemplateSource   -> Produces XmlProjectTemplates and XmlFileTemplates
   * SvnTemplateSource   -> Produces XmlProjectTemplates and XmlFileTemplates

Keeping in mind the above architecture, I am anticipating the following areas
which will probably require some extra work.

 * Unresponsive UI due to network latency.

   ITemplateSources which fetch data over the network might end up showing
   considerable latency in the New Project/File dialogs. One way to mitigate
   this would be to have a virtual property in ITemplateSource called
   FetchInAnotherThread. If the New File/Project dialog finds this property true
   in any of the addins, it would start call the 'GetTemplateList' (or whatever) 
   method in another thread while displaying a 'Please Wait' on the UI. The
   addin will also have to intelligently fetch the template lists - fetching
   only what is required and caching data optimally.
 
 * Network Errors

   Recovering from (failing gracefully at the very least) in the face of network
   errors.
 
 * Versioning
   
   Templates should be 'versionable' and since we're downloading templates, 
   compatibility of the templates (wizards) with the host system should be verifiable
   before the download. Basically, if the user is able to create a project from
   a template on his machine, s/he should also be able to compile it
   successfully.


Timeline
-------

I plan to use the following checkpoints as a measure of my progress.

Bootstrapping
  
    Divide the functionality logically into the various interfaces and come up
    with a set of extension points which make sense. Code this entire addin
    architecture. Document everything. Re-do the New File/Project dialogs and
    implement plugins with dummy data to test them. Concretely define what all a
    project template consists of.

    Deliverables:
     > A solid addin framework from which to take off, 
     > Extensive documentation which should get anyone up to speed about what the
       internal API is like.

The Web Portal (Shall go on in parallel with everything else)

    Create the web-interface, along with specifications about how the clients
    are supposed to exchange information with the web portal. The functionality
    shall be as mentioned in [Objective & Final Deliverables].

    Deliverables:
     > The web portal.
     > The specifications - Communication with the portal would possibly involve
       GETing and POSTing few XML files.

Template Creators

    A wizard which creates a template out of a project or a file and allows to
    either save the template locally for later uploading or automatically
    uploads it to the portal. It checks for non-standard assemblies and bundles
    them along with the template (after prompting of course). It should also
    ensures that the template bundle is architecture independent (at the very
    least it should detect such a thing and warn the user). It should also strip
    out other user specific information from the source files (for instance the
    license) and replace them with equivalent macros.

    Deliverables:
     > The above.

The Web API

    A thin API layer which handles connects to the portal and offers services 
    like searching for and downloading template bundles.

    Deliverables:
     > The above library.
     > A basic console application which can be used to test the above API.

Deploying the Server

    The WebApp will have been ready by now. This subtask would involve deploying the
    application to the Google App engine.

    Deliverable:
     > The deployed webapp which can be interacted with in real time.

The Final Plugins

    The Web API shall be used to develop a WebTemplateSource, complete with
    HTTPS authentication support. SharpSVN shall be used to create an addin
    which fetched templates from a mentioned SVN repository.
    
    Deliverable
     > The above.

A final phase would involve tying up loose ends up, writing some more
documentation and polishing up the entire system. It would also involve writing
a few wizards as a proof of concept.

About Me
--------

I'm a second year undergraduate student from the Indian Institute of Technology,
Kharagpur, India.

CURRENT INVOLVEMENT - I have been hacking around The Mono Project for a little
more than a month now, and I have a total of three (two in MonoDevelop and one
in the mono runtime) patches in the trunk.

SKILL SET - Skipping out all but the relevant parts, I have been writing C# for
over an year now (though I haven't written anything large) and consider myself
proficient enough to undertake this project. The last time I touched Django was
6 months back and while I do remember quite a bit, I plan on undertaking a
small web-app project before I GSoC starts to re-familiarize myself with the same.

Future Work
-----------

While the completion of the project should roll out a fairly complete addition
to the MonoDevelop IDE, a few things that I consider working upon after the GSoC
or in case the above objectives are completed ahead of schedule are

 * A more intelligent template generating wizard - one which figures out if a
   similar template exists in the repositories (and says so). Various other
   things like language agnostic templates (say C# and VB .NET) may be
   worked on.
 * Support for more sources - More template sources, like GitTemplateSource and
   FTPTemplateSource, SSHTemplateSource may be added.
 * Refactor Templates - One should be able to tweak some basic wizard parameters
   _after_ a project has been created from the same.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/monodevelop-list/attachments/20100323/aa07e635/attachment-0001.bin 


More information about the Monodevelop-list mailing list