Silvelight solution

Jun 23, 2011 at 11:05 PM
Edited Jun 24, 2011 at 12:39 AM

Hi,

I am looking for a solution to create a Silverlight DSL model editor with your framework. Any thoughts? Is there a way to generate usable library code for a silverlight program?

 

Reggie

Coordinator
Jun 24, 2011 at 9:08 AM

Hi reggie,

unfortunately there is no support for silverlight in PDE. Every model in PDE (generated classes for elements, relationships, ...) relies heavily on the Microsoft DSL Tools library, which is not a silverlight library. As far as I know there is no way to reference such a library in a silverlight project (my knowledge in silverlight is very limited though).

Jun 27, 2011 at 8:08 PM

Hi,

Thank you. I don't really have hands-on experience on using Microsoft DSL tool and T4, but if the generated WPF editor has implemented M-V-VM pattern, is it possible to have T4 generate a silverlight command wrapper and its counter-part of WCF service at the backend that deals with persistence, which the current codebase has already addressed?

We plan to build our system with Prism, and its MV-V-M is implemented for both Silverlight and WPF. Take a look at the codeplex project http://prismappdesigner.codeplex.com/  It doen't have any implementation yet, but they seem to have the same idea as yours, but use Prism for its M-V-VM implementation.  

If your T4 generates an M-V-VM application, the modeling and the persistent part should be in M and VM layers, may be its just some code refactoring work for me to use PDE in Silverlight? What is your thought? 

Reggie

Coordinator
Jul 3, 2011 at 9:59 AM
Edited Jul 3, 2011 at 10:00 AM

Hi reggie,

Using a WCF service at the backend to host PDE domain models is technically possible, but I don’t really see the point, because PDE domain models weren’t designed to be hosted on servers. There is no SQL support and whenever you load a DSL instance you load all elements and relationships. Additionally, for every client working on a new DSL you would have to create a new instance of the domain model on the server. So this is probably not a good idea.

We do use code generation to create MVVM-based WPF applications, but PDE is not a MVVM-framework as is PRISM e.g., it is a framework to develop domain specific languages with the key idea of visualizing and editing those languages within WPF-apps or Visual Studio-plugins (MVVM-based). The difference is, that out generated ViewModels have knowledge about the data they visualize. Therefore, we cannot use those VMs in a Silverlight environment as they have dependencies on non-Silverlight libraries.

So sadly there is no easy fix to get PDE to support Silverlight.

The idea of http://prismappdesigner.codeplex.com/ is interesting. I did some testing with code generation and WCF and it can be used quite well. You can basically generated sql definitions, domain service classes as well as basic view models from PDE metamodels. So maybe that is something that we are going to pursue for PDE as well in the future.