Everyone is in the cloud

So – these days everyone is in the cloud so how come I’m not? I guess that this is a question we all ask ourselves from time to time Ler or not…

Well I felt a strong need for “dogfooding” on ECO and AppComplete to see if the products really worked in real life cases. I had a solution I just needed a problem – awkward but not uncommon for a guy like me.

I set out to create the cloud service AppCompleteCloud.  I have been working on and off on this for quite some time(6 months). When doing things with very low intensity you need to make sure that they are dead simple to understand. Since you will have forgotten any intricate details the next time you have a few minutes to attack the code.

Luckily model driven development the way we do it is perfect for this – everything stays clean and easy to grasp even if you are having your brains electrocuted between the coding sessions. (I have heard that they still do that to cure depression – fantastic – Are you depressed? Yes –> ZAPPP! Are you still depressed? HELL NO! So it must have worked then?).

I needed to define my problem. This is what I ended up with:

  1. Upload models to the cloud so that others may look at them without any special tools
  2. Let those people comment on the things they see
  3. Let the developers with the standard tools (AppComplete and ECO) discover and answer those comments

But then I had to make a lot of decisions:

  1. Can just anyone look at any model?
  2. What cloud platform should I use?
  3. What database should I use if any to keep the data in?
  4. Should everything be done as syncron actions, or do I need some background worker?
  5. How can I avoid spending a lot of time on user administration code?
  6. Can I use a ViewModel driven UI?

And during the cause of this project I answered all those questions, and

  • I found and corrected loads of bugs in ViewModels for ASP.NET
  • I added a http-handler to ECO.WEB so that I easily can show images from blob types
  • I ensured that the SqlServer PersistenceMapper works with SQLAzure
  • I learned a lot about federated login with Azure
  • I extended Modlr to signal and show Cloud comments
  • And a lot of other lessons learned

The solution

I ended up doing this on the Azure platform. It’s a neat and cool way to consume data power just in time.

This is the Azure admin UI

image

In VisualStudio I have my Azure project that is really an ECO project:

image

From within VS I just have to say “Publish” – then sit back for 20 minutes (YES I KNOW, INSANELY LONG TIME), while some container in some industrial park somewhere in the northern Europe, filled with cpu’s, that runs virtual machines, creates a new deploy machine, installs WindowsServer 2008R2 on it, then applies my application package, then makes a swift and almost invisible handover from the old deploy machine to the new deploy machine. And the new version is out… Pretty cool – but would not “boring industrial park” be a more descriptive term than “cloud”?

The AppCompleteCloud model

image

 

The AppCompleteCloud model is as above. The Green classes; Screen,ThingOnScreen, ThingInModel is what actually constitutes the stuff we track. But the whole modlr file is kept as a blob attribute called ModelZip in the Yellow class Model. This attribute has “DelayedFetch==true” , this is important since we do not want to load that all the time we present a model. The Gray classes track the user info; we use federated login but create a user object as reference so that we can allow for our application specific access policies – like who uploaded the model, who can access it, who can replace it. The pink class Comment points out a user and a Thing on the Screen – easy as pie. There is a state machine controlling the rendering state of the model.

I also created some ViewModels with UI-hints:

Like searching for users:

image

  And for administration for one model:

image

And then some for the different needs of the application.

This way I can hold the code to absolute minimum. The typical code behind in this application looks like this:

protected void Page_Load(object sender, EventArgs e)
{
  ViewModelASPNET1.GridsHasEditButton = false;
  ViewModelASPNET1.GridsHasDeleteButton = false;
  ViewModelASPNET1.OnGridViewSelection += new EventHandler<ViewModelForAspNet.OnGridViewSelectionArgs>(ViewModelASPNET1_OnGridViewSelection);

  ViewModelASPNET1.SetObject((Master as SiteMaster).User);
  ViewModelASPNET1.DataBind();
}

void ViewModelASPNET1_OnGridViewSelection(object sender, ViewModelForAspNet.OnGridViewSelectionArgs e)
{
  if (e.ViewModelClass != null && (e.Selected as string) != null)
  {
    if (e.ViewModelClass.Name == "UploadedModels")
      Response.Redirect("ModelAdmin.aspx?show=" + (e.Selected as String));
    else if (e.ViewModelClass.Name == "Models")
      Response.Redirect("ModelView.aspx?show=" + (e.Selected as String));

  }
}

The result

image

image

From within AppComplete or ECO you can upload any model to AppCompleteCloud.

You need a service password that you set in AppCompleteCloud:

image

Once you have uploaded the model you can find it amongst your models:

image

Select to look at it:

image

Click something to read more or be able to comment:

image

image

Now switch back to AppComplete or ECO, and CloudForm:

image

And we see a symbol in the diagram:

image

If I click it a new form shows up:

image

If I answer the comment and close the form, the symbol switches to green to signal that there are comments but all are currently answered:

image

Now back to the CloudForm in AppComplete or ECO:

I upload the model again – I likely have done changes – so just uploading the answers to the comments seems like an odd case that will not be used very often – upload the whole model and let AppCompleteCloud re-render it:

image

And the comment is answered and the user might be very happy with the answer…

Controlling access

Looking at your models:

image

And you get to the admin UI:

image

Here you can reset the rendering state machine and start it over – afaik you will not have to do this manually unless something has gone very wrong.

You can add users – a new window that helps you search on the name is shown – pick one and you have added that user. Then edit what specific rights you give that user.

 

Oh, you can also have your users access the XPS report I talked about here just by clicking this:

image

image

Summing it up

So what do you think? Useable or absolute crap? It has been very educational for me anyway and I am certainly doing more cloud based services in the future – and yes – they will definitely be model driven! 

This entry was posted in AppCompleteCloud, ASP.NET, Azure, Documtr, MDrivenDesigner, Modlr, UML, VisualStudio, WCF. Bookmark the permalink.

2 Responses to Everyone is in the cloud

  1. Peter Buchmann says:

    Interresting.

    Do I understand it right that this could develop to a platform where ECO users can discuss and share models? So if I have a specific need of a model for a new project I could get a model from here? I could maybe even test this model by using the prototype function of ECO using ASP.NET or silverlight autoforms and viewmodels?

    It could also be interresting to use a open area of this system as a demo for ECO as marketing tool on the CapableObjects website. This could maybe convince people to use ECO. As for now the have to download ECO to be able to see it live.

    Could you explain your business idea behind the AppCompleteCloud.

    /Peter

    • Admin says:

      The initial idea was and still is to allow for a cloud based prototyping platform. A platform where you can upload a model and execute it so that users can run it and give feedback. In This first iteration we allow for users to consume the model and give feedback without any special tools.

Leave a Reply

Your email address will not be published. Required fields are marked *

*