TemplateStudio unavailable

Posts   
 
    
MichielAlders avatar
Posts: 30
Joined: 01-Sep-2009
# Posted on: 15-Sep-2009 14:55:14   

I'm pretty sure this is the limitation of the Demo version but to make sure I'm asking the question anyway:

Is TemplateStudio shipped with the Demo version of LLBLGen Pro 2.6 or is this only delivered for paying customers?

I wanted to test to extend some classes to some common functions that our developers come a cross frequently so I wanted to know if these thing can be generated with TemplateStudio.

For Example:



Namespace Probe.HelperClasses

    Partial Class EntityCollection(Of TEntity As {EntityBase2, IEntity2})
        Inherits EntityCollectionBase2(Of TEntity)

        Public Function Find(ByVal field As EntityField2, ByVal value As Object) As EntityCollection(Of TEntity)
            Dim returnValue As New EntityCollection(Of TEntity)
            Using adapter As New DataAccessAdapter
                Dim Filter As New RelationPredicateBucket(field = value)
                adapter.FetchEntityCollection(returnValue, Filter)
            End Using
            Return returnValue
        End Function

    End Class

End Namespace

This because not all developers want to get familiar with the LLBLGen Pro syntax. And would like:


        Dim changes As New EntityCollection(Of ChangesEntity)
        MsgBox(changes.Find(ChangesFields.ID, 157)(0).Topic)

More then:


        Dim changes As New EntityCollection(Of ChangesEntity)
        Using adapter As New DataAccessAdapter
            Dim Filter As New RelationPredicateBucket(ChangesFields.Prsld = 157)
            adapter.FetchEntityCollection(changes, Filter)
        End Using
        MsgBox(changes(0).Topic)

Walaa avatar
Walaa
Support Team
Posts: 14987
Joined: 21-Aug-2005
# Posted on: 15-Sep-2009 15:03:00   

Is TemplateStudio shipped with the Demo version of LLBLGen Pro 2.6 or is this only delivered for paying customers?

That's right, not available with the demo version.

This because not all developers want to get familiar with the LLBLGen Pro syntax.

What about using LINQ?

MichielAlders avatar
Posts: 30
Joined: 01-Sep-2009
# Posted on: 15-Sep-2009 15:25:15   

That would also mean they all have to learn the LINQ syntax, what some of them aren't looking forward to.

Walaa avatar
Walaa
Support Team
Posts: 14987
Joined: 21-Aug-2005
# Posted on: 15-Sep-2009 16:10:39   

As soon as you buy a license you'll be able to download the Template Studio, and then your developers would have to learn nothing new simple_smile

MichielAlders avatar
Posts: 30
Joined: 01-Sep-2009
# Posted on: 15-Sep-2009 16:15:41   

Yeah that was part of the question. With TemplateStudio this is easy to do? That would be a blast.

@below: It was a pretty bad example simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39771
Joined: 17-Aug-2003
# Posted on: 15-Sep-2009 16:15:41   

Template studio is a rudimentary template editor, which simply uses the same generation engine as llblgen pro does. Using .lpt templates you can generate everything you want.

To extend classes you first should look into writing generic methods which can be used with whatever class you pass to them, instead of generating code all over the place. For example often code can be placed in a partial class of CommonEntityBase which makes the code available to all entity classes. If you make that code generic (e.g. by working with the IEntity(2) interfaces) you can make the code pretty compact and it's not requiring code generation.

so in your case, the Find method could best be placed in a partial class of EntityCollection(Of T), as it's not entity specific it seems

Frans Bouma | Lead developer LLBLGen Pro