Monday, February 28, 2011

CODE Magazine - Article: From Zero to Business Application in 15 Minutes

CODE Magazine - Article: From Zero to Business Application in 15 Minutes: "For Customer, I will add a computed field for the summary property called FullName by clicking on the “Computed Property” button at the top of the designer. This sets the Is Computed property in the properties window for you and an “Edit Method” link appears. This method is where you return the value of the computed field. Computed fields are not stored in the underlying database; they are computed on the entity and only live in the data model. For FullName, I will return “LastName, FirstName”.

Public Class Customer

Private Sub FullName_Compute(
ByRef result As String)

' Set result to the desired field value
result = Me.LastName + ', ' + Me.FirstName
End Sub
End Class"



----------------------------------------------------
This really bugs me. It's from a article about Microsoft's new LightSwitch tool. The problem is a SUB returning a value. That is the very definition of a FUNCTION.

This supposed to make life easier and allow you to get apps up and running fast. It also appears they have a new data type called string that will be stored in SQL Server. So presumably it will it end up as Varchar or Char data type. They will have to prove that this abstraction will not result in problems in the real world.