views:

136

answers:

0

This is based on my assumption that taking an object of type:

public class Fruit : IBasicFruit, IFruitDetails
{
    // IBasicFruit implementation
    public string name { get; set; }
    public string color { get; set; }

    // IFruitDetails implementation
    public string scientific_name { get; set; }
    public bool often_mistaken_for_vegetable { get; set; }
    public float average_grams { get; set; }
    public int century_domesticated { get; set; }
}

... and from it creating an object of type:

public class BasicFruit : IBasicFruit
{
    public string name { get; set; }
    public string color { get; set; }
}

... is known as "projection", or "type projection" (that projection applies not only to anonymous types).

Now, let's say I send a serialized BasicFruit from a server to my client application, where some highly sophisticated farm logic is performed on those two strings, and then it gets sent back to the server, where the ORM is not aware of the BasicFruit type, only of the Fruit entity type. If I create a new Fruit object based on my BasicFruit object (ignoring the properties that do not exist in BasicFruit), so my ORM can persist it, is that the opposite of projection, because I am going from subset to superset, or is it still considered projection, or is this just mapping?

Could projection be considered a form of mapping?