# Tuesday, March 15, 2011
Design Notes
  • Application is computerized behavior to achieve a business goal
  • Application Protocol is a set of rules of allowed/legal interactions in an Application
  • Application State is an instant of time of the Application
  • URIs are used for resource identification
  • HTTP Methods/Verbs are used as the Uniform Interface
  • Resources are a logical representation of the Domain Model/Data Set
  • Resource Representations are transformations/views of Resources state at an instant of time
  • Resource Representations are requested via headers
  • There is a one to many relationship between a resource and its representations
  • Access to Resources is always mediated by way of Resource Representations
  • Hypermedia Resource Representation allows lazy-cacheable access that advertise permitted transitions
  • Use Transaction Resources to create stateless interaction
Design Procedure
  1. Figure out the Domain Model/Data Set (if it does not already exists)
  2. Split the Domain Model/Data Set into logical Resources
  3. Name the resources using URIs i.e. /orders, /orders/{key}, etc.
  4. Expose your subset of the uniform interface i.e. GET/POST/PUT/DELETE
  5. Design the Resource Representations
  6. Design the Hypermedia Resource Representations integration
  7. Design Scenarios, Alternative Paths & Error Conditions   
posted on Tuesday, March 15, 2011 8:25:37 PM UTC  #    Comments [0]
# Saturday, March 05, 2011

Navigate to The Accounting Engine

image

Fill and submit the Request

image

Make sure to have a valid email. 

image

The email will contain among other information a link to the Subscription where you will complete the registration.

image

Complete and submit the Subscription

image

After the Accounting Data is created a logon is displayed

image

Use the information from the email sent to login

image

When you login successfully as an Administrator you will be redirected to the Settings.

posted on Saturday, March 05, 2011 5:23:05 PM UTC  #    Comments [0]
# Thursday, March 03, 2011

Update: This situation has been resolved

Back on October last year I got an email from Microsoft in which they said that they were trying to charge my company credit card for services I was not receiving. I responded:

image

They ignored my request and continued sending the same stupid message only changing the Notice # and I continued replaying:

image

I consider this a harassment and that Microsoft is trying to damage my company reputation and credit history.

If they continue this path I will take legal action to stop this Character Assassination attempt!

posted on Thursday, March 03, 2011 8:49:00 PM UTC  #    Comments [0]
# Thursday, August 19, 2010

Today after downloading and installing Crystal Reports for Visual Studio 2010 Beta 2 I got this message:

CRforVS2010_Beta2

I understand that it is a beta but do they test this stuff!

I am lucky that I always install these kind of software in a test system but it is annoying and time consuming. 

posted on Thursday, August 19, 2010 1:55:19 PM UTC  #    Comments [0]
# Thursday, August 05, 2010

image

 

Can someone from Microsoft explain What is the job of their "Dirteam"?

This is the response I got so far. Is this arrogance or what?:

image

posted on Thursday, August 05, 2010 3:14:54 PM UTC  #    Comments [0]
# Saturday, July 10, 2010

I don't know when and how it happened, maybe when I installed VS 2010 side-by-side with VS 2008, but my VS 2010 default language was set to Visual Basic and I don't use "that thing" anymore. I ignored it for a while since I have been just converting from VS 2008 but it got annoying because every time I created a new project it was created with Visual Basic so I had to delete it and recreate it.

Finally I decided to change the setting but I was looking on the wrong place Tools -> Options. After a while I found this eggheadcafe posting and as it said it is Tools -> Import and Export Settings.:

image

Save your current settings in case you change your mind later: (not me :-))

image

Then select Visual C# Development Settings and click Finish:

image

posted on Saturday, July 10, 2010 6:32:56 PM UTC  #    Comments [0]
# Tuesday, May 18, 2010

While installing Silverlight 4 Tools v1.0 for Visual Studio I ran into the following screen sometimes after the installation hanged for a while:

image

I had found that problem before while trying to install SQL Server 2008 so I located the following registry key:

image 

and removed this from the PendingFileRenameOperations

image

After doing that I ran the installation again and it completed successfully.

image

posted on Tuesday, May 18, 2010 3:32:43 PM UTC  #    Comments [0]
# Friday, May 14, 2010

Let the source code speak: (This is from a real application not "Demoware")

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;
using CBSI.GL.Application;
using CBSI.NHibernate.DomainServices;
using CBSI.GL.Domain;
using CBSI.GL.DA;
using CBSI.TAE.Dashboard.RIAServices.Web.Properties;

namespace CBSI.TAE.Dashboard.RIAServices.Web.Services
{
    [EnableClientAccess()]
    public class AccountCategoryDomainService : GLDomainService<AccountCategoryRepository, AccountCategory, long>
    {
        IAccountCategoryService _AccountCategoryService;
        public AccountCategoryDomainService(IAccountCategoryService accountCategoryService) : base(accountCategoryService.Repository)
        {
            _AccountCategoryService = accountCategoryService;
        }

        public IEnumerable<AccountCategoryModel> Categories()
        {
            return from c in this.Repository.All where (c.GLSetup.ID==this.GLSetup.ID)
                   orderby c.Name
                   select new AccountCategoryModel(c); 
        }

        public void Insert(AccountCategoryModel model)
        {
            if (this.Exists(model.Name))
                throw new ApplicationException(string.Format(Resources.AlreadyExistEntityWithName, Resources.Entity_Name_Category, model.Name));
            AccountCategory accountCategory =  new AccountCategory(this.GLSetup);
            accountCategory = model.ToDomain(accountCategory);
            SaveTransaction(accountCategory);
            this.ChangeSet.Associate(model, accountCategory, MapToModel);
        }

        public void Update(AccountCategoryModel model)
        {
            AccountCategory accountCategory = this.Repository.Get(c => c.ID == model.ID);
            if (accountCategory==null)
                throw new ApplicationException(string.Format(Resources.UpdatingNonExistingEntity, Resources.Entity_Name_Category));
            accountCategory = model.ToDomain(accountCategory);
            SaveTransaction(accountCategory);
            this.ChangeSet.Associate(model, accountCategory, MapToModel);    
        }

        public void Delete(AccountCategoryModel model)
        {
            AccountCategory accountCategory = this.Repository.Get(c => c.ID == model.ID);
            if (accountCategory == null)
                throw new ApplicationException(string.Format(Resources.DeletingNonExistingEntity, Resources.Entity_Name_Category));
            DeleteTransaction(accountCategory);
        }

        bool Exists(string name)
        {
            var ac = this.Repository.Get( c => c.Name == name);
            return (ac != null);
        }

        void MapToModel(AccountCategoryModel acm, AccountCategory ac )
        {
            acm = new AccountCategoryModel(ac);
        }
    }
}

posted on Friday, May 14, 2010 2:58:49 PM UTC  #    Comments [0]
# Wednesday, April 21, 2010

When talking about the Model View ViewModel (MVVM) , Model View Controller (MVC) or any other presentation patterns Model some people refer to it as the Database Model, others as the Domain Model. Well, it is actually referred as a Presentation Data Model.

Your database or domain types could have many properties that the View does not care about and it will be a waste of resources as well as a security risk to have all that data traveling back and fourth the network even if it is an intranet.

Another problem with using Database or Domain data in your MVVM is that any change to the database or domain will require to update all the clients and that could be very costly.

Let's assume for example that we have the following very simple Domain Model:

SSLDomain

and the following Database Model:

image

Note: I created the Database Model using the following NHibernate mapping:

     
 
<?xml version="1.0" encoding="utf-8"?>
<!--Generated with CyberBizSoft's NHibernate Helper on 12/16/2009 11:30:06 PM -->
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="CyberBizSoft.SSL.Domain" 
namespace="CBSI.SSL.Domain">
    <class name="Store" table="SSLStores" lazy="false" >
        <id name="ID" unsaved-value="0" column="ID" type="System.Int64">
            <generator class="identity" />
        </id>
        <property name="Name"/>
        <property name="Description"/>
        <component name="Contact" class="CBSI.Common.Domain.SingleContact, 
CyberBizSoft.Domain" >
            <component name="Address" class="CBSI.Common.Domain.Address, CyberBizSoft.Domain">
                <property name="Street" column="Street" />
                <property name="City" column="City" />
                <property name="State" column="State" />
                <property name="ZipCodeNumber" column="ZipCodeNumber" />
                <property name="Country" column="Country" />
            </component>
            <component name="Phone" class="CBSI.Common.Domain.Phone, CyberBizSoft.Domain">
                <property name="FullNumber" column="PhoneNumber"/>
            </component>
            <component name="Fax" class="CBSI.Common.Domain.Phone, CyberBizSoft.Domain">
                <property name="FullNumber" column="FaxNumber"/>
            </component>
            <component name="EMail" class="CBSI.Common.Domain.Url, CyberBizSoft.Domain">
                <property name="URL" column="EMailAddress"/>
            </component>
            <component name="Web" class="CBSI.Common.Domain.Url, CyberBizSoft.Domain">
                <property name="URL" column="WebAddress"/>
            </component>
        </component>
    </class>
    <!--Copyright (c) 2001 - 2009 by CyberBizSoft, Inc. All rights reserved.-->
</hibernate-mapping
 
     

 

Let's say that we have to create an interface only to change the Name and Description of this Store. Why would we have to bring all the other information into the client if we only need the Store's ID, Name & maybe Description?

Preferably we could create a very simple presentation data model (StoreNameModel) which we could adorn with presentation specific attributes,

class StoreNameModel
{
    [Key]
    public long ID { get; set; }
    [Required]
    public string Name { get; set; }
    public string Description { get; set; }
}

map the data from the Domain Store in the service to the StoreNameModel

public IQueryable<StoreNameModel> Stores()
{
    return from c in Repository.All
           orderby (c.Name)
           select new StoreNameModel() { ID = c.ID, Name = c.Name, Description = c.Description };
}

and then project it into the ViewModel in the client.

Update (4/23/10)

I found this post by Deepesh Mohnani about the WCF RIA Presentation Model    

 

 
posted on Wednesday, April 21, 2010 6:43:46 PM UTC  #    Comments [0]
# Tuesday, April 20, 2010

If you create a Silverlight application using the WCF RIA Services Class library and with the following walkthrough when you try to access the Context for the RIA application (WebContext) it is not there.

Since we did not enabled the WCF RIA Services for the Silverlight application the WebContext class is not generated in the client.

  image

You can verify this by selecting the Silverlight application in the Solution Explorer, click the Show All Files button in the Solution Explorer toolbar and then inspecting the hidden "Generated_Code" folder.

The workaround is to right click on the Silverlight application in the Solution Explorer, select Properties and  temporarily enable the WCF RIA Services by selecting the web project in the WCF RIA Service link.

 image

Then rebuild the solution find and copy the WebContext class in the file [YourServerAssemblyName].g.cs in the afore mentioned folder to a new file WebContext.cs somewhere in the Silverlight application project.

Now right click on the Silverlight application in the Solution Explorer again and select <No Project Set> in the WCF RIA Service link and rebuild again. "Generated_Code" folder content will be removed.

This is kind of a hack and I believe it could be solved if the WCF RIA Services Class Library template will check if the WebContext exists in the Silverlight application and if not exist it will generate it.

Update (4/26/2010)

If you move the WebContext.cs file to the WCF RIA Services library client make sure to update your app.xaml with the following:

<app:WebContext>
            <app:WebContext.Authentication>
                <appsvc:FormsAuthentication
DomainContextType="[TheNamespaceOfYourRIALibrary].AuthenticationContext,
[TheNameOfYourRIAClassAssembly ], Version= [X].0.0.0"/>
                <!--<appsvc:WindowsAuthentication/>-->
            </app:WebContext.Authentication
   </app:WebContext
posted on Tuesday, April 20, 2010 6:56:54 PM UTC  #    Comments [0]