Archive for March, 2012

What’s CodeFluent Query Language?

March 30, 2012 Leave a comment

CodeFluent Query Language (a.k.a. CFQL) allows you to write platform independent data accessing queries which producers (producer = code generator) will translate into optimized stored procedures.

For instance you can define the following CFQL query in your model:

<cf:method name="LoadByName" body="load(Name) where Name startswith @Name"/> 

The SQL Server Producer will generate the following stored procedure:

CREATE PROCEDURE [dbo].[Test_LoadByName] 
@Name [nvarchar] (256) 
SELECT DISTINCT [Test].[Test_Id], [Test].[Test_Name] 
    FROM [Test] 
    WHERE ([Test].[Test_Name] LIKE (@Name + '%'))


And the Oracle Database Producer will generate the following equivalent:

        "#Name" NVARCHAR2) AS 
    V_CF_CURSOR "Sample"."CF_#Runtime".CF_CURSOR_TYPE; 
        SELECT "Test"."Test_Id", "Test"."Test_Name" 
            FROM "Sample"."Test" 
            WHERE ("Test"."Test_Name" LIKE ("#Name" || N'%')); 

As you can see data accessing queries are not built in-memory dynamically at run time but instead a classic stored procedure is generated at development time.

As a consequence developers can:

  • see what’s going to happen at run time and avoid bad surprises (like this one when using EF for instance),
  • debug it easily if they need to,
  • change the code if the need to.


Carl Anderson

SoftFluent Team at DevWeek London!

March 26, 2012 Leave a comment
Categories: News Tags:

CodeFluent Entities: Initializing your application with data

March 26, 2012 Leave a comment

In our previous posts, we’ve seen that from a single platform independent model (see CodeFluent Entities is not an ORM) you can generate continuously (see Continuous Generation) complete databases, .NET classes, web services or UIs.

That’s great but when you’re developing your application, this will all be empty and just like an empty party, an empty app is no fun Smile

Well using CodeFluent Entities, from Visual Studio, you can specify “instances of data” in your model. What’s great about instances is that persistence producers such as the SQL Server producer, Oracle Database producer or SQL Azure producer, will translate those into a SQL script which will insert/update data in your app!

Here’s an example:

Select an entity and click on “Add Instance” to add instances one by one using the instance dialog.

You can also use the instance grid (accessible from the ribbon, in the “Batch Modeling” group) to multiple instances at a time in a grid:


For the newcomers, we published a while ago a 1 minute video illustrating how to generate code and data using CodeFluent Entities, plus using the generated code right away in the following post: How to generate with data (video)


Carl Anderson

CodeFluent Entities: Continuous Generation

March 21, 2012 1 comment

In the previous post, CodeFluent Entities is not an ORM, I briefly talked on how CodeFluent Entities is different from an ORM as your not mapping a database to an object model but instead your defining a model from which you’ll generate stuff depending on the code generators (a.k.a. “producers”) you specified in your project.

Therefore CodeFluent Entities is a very DRY product as from a single model you’ll update consistently your database, classes, services, UIs, and so on. However, as we developers know, there’s absolutely no way you’re going to model your entire application the right way on the first shot: specs move along, we always forget something or just did not think of a particular scenario…

As a consequence such a product would be useless without continuous generation. By continuous generation I mean that you can go back to the model do some changes in it and generate over to update consistently all your layers without losing changes nor data!


Everything starts from the database where CodeFluent Entities’ differential engine enables hassle-free schema updates without losing any data.

Say you have an existing Customer entity:

From which you generated a Customer table containing data:

Adding a new Name property to the entity:

And generating over will preserve our existing data:

Last but not least, please note that things like up-casting, adding/removing constraints or relations are fully supported so you can generate continuously throughout your developments.



Carl Anderson

CodeFluent Entities is not an ORM

March 20, 2012 1 comment

CodeFluent Entities is a unique product integrated into Visual Studio 2008/2010/vNext which allows you to generate components such as scripts (e.g. T-SQL, PL/SQL), code (e.g. C#, VB), web services (e.g. WCF, ASMX) and UIs (e.g. ASP.NET, SharePoint, WPF).

The code generation process is model-first and continuous: from your declarative model, a meta-model will be inferred which code generators will then translate into code. Over 20 code generators (a.k.a. “producers”) are provided “out of the box” and can be combined to create your own application following your desired architecture, using your desired technologies.

For instance, adding an instance of the SQL Server Producer to your project will translate your model into a database (schemas, tables, stored procedures, views, constraints, etc.):

Adding an instance of the Business Object Model Producer will translate your model into .NET classes (C# or VB.NET) consuming the persistence layer:

Adding a WCF Producer will generate WCF services, contracts and proxies exposing your .NET classes:

Adding a WPF Smart Client Producer will generate a WPF application consuming the WCF services thanks to the generated proxy:

And that’s just an example of what you can do: you can also build ASP.NET web sites, SharePoint apps, Windows Forms apps, Silverlight apps, etc.

Your application is layered following best practices, all its business logic is in the middle-tier (the Business Object Model generated by the Business Object Model producer), and supporting a new technology gets down to adding a new producer or creating screens on the generated code.

Last but not least, you can create your own producer which translates this inferred meta-model into what you need.



Carl Anderson

March 19th 2012 Links: Windows 8, Visual Studio 11 Beta, Office 15, SQL Server, Tips

March 19, 2012 Leave a comment

Wow, this was a busy month!!

Here’s our latest batch in our link-listing series:

Windows 8

Windows 8 Consumer Preview

The Windows 8 Consumer Preview is now available!


Optimizing the .NET Framework Deployment Experience for Users and Developers

A great article which looks at the integrated experience that Windows 8 provides to run apps built for the .NET Framework.


Visual Studio 11 Beta

Welcome to the Beta of Visual Studio 11 and .NET Framework 4.5

Jason Zanders announces that Visual Studio 11 Beta, Team Foundation Server 11 Beta and .NET Framework 4.5 Beta are now available for download!


Introducing the New Developer Experience

In this blog post the Visual Studio Team introduces a few of the broad reaching experience improvements that they’ve delivered in Visual Studio 11.


Visual Studio 11 Beta Frequently Asked Questions (FAQ)

Jason Zanders answers some frequently asked questions on Visual Studio 11 Beta.

Note: Read the comments! Especially Patrcik Smacchia’s question:

-> Is there a chance that the VS team takes account of the thousands of negative feedbacks concerning greyish icons, and switch back to VSpre11 colorful icons?

To which Jason Zanders answered:

@Patrick – we have definitely heard the feedback.  as mentioned above, the beta is about getting feedback and will not reflect the final look and feel


Coming Soon: TFS Express

In TFS 11, Microsoft is introducing a new download of TFS, called Team Foundation Server Express which is free for individuals and teams of up to 5 users.


The C# 5.0 Beta Release is now available

Included in the Visual Studio 11 Beta, the C# version 5 and Visual Basic version 11 are shipped.


Office 15

Microsoft SharePoint 15: A 2012 release target, an app marketplace and more

Microsoft is adding new features to the next versions (Wave 15) of its SharePoint Server and SharePoint Online offerings. Mary Jo Foley takes an early look at some of them.


Microsoft chops Office 365 enterprise prices by 20%

Yay!! Price reductions!!


SQL Server

SQL Server 2012 RTM Available for Download

The new SQL Server version is available for download


Software Development

Envisioning the Future of UX: WebVisions NYC 2012

Some takeaways from the WebVisions NYC 2012 conference by Miao Wang



Carl Anderson

New CodeFluent Entities Version Released!

March 16, 2012 1 comment

A new CodeFluent Entities version (646) has been released and is publicly available!

You can download it from here: CodeFluent Entities Download Page.


Enhanced Visual Studio 11 Beta integration

Remember the “CodeFluent Entities & Visual Studio 11 Beta” post? Well we kept our word and corrected the glitches Winking smile


SQL Server 2012 is supported by the SQL Server Producer

More details in this post: Added SQL Server 2012 Support


Enumeration declarations now support named values

You can now do stuff with multi-valued enumerations such as (supported separators are , ; | and +):

    <cf:enumeration name="WeekDays" multivalue="true" >
      <None />
      <Sunday />
      <Monday />
      <Tuesday />
      <Wednesday />
      <Thursday />
      <Friday />
      <Saturday />
      <WeekDays value="Monday,Tuesday,Wednesday,Thursday,Friday" />

(Thank you GregD for the suggestion)


Project Level “Implements” and “Set Implements” rules

You can define “Implements” and “Set Implements” rules at project level so all generated classes implement a specific interface or derive from a specific class (


Transaction rules

Transaction rules can now be added on methods other than Save and Delete, including custom ones. Developers don’t have to write the TransactionScope code themselves when adding a new custom method: all it takes is selecting your method and add a transaction rule on it Smile


The Modeler now supports Aspect assemblies

If you are familiar with CodeFluent Aspects, you already know that you can develop aspects in XML or in .NET assemblies.

You’ll be glad to know that the Modeler now fully supports .NET assemblies including assemblies containing multiple aspects (e.g. Contoso.Aspects.dll). In such cases it displays available aspects in the assembly and lets you select the one you want to use in your current CodeFluent Entities project.


Miscellaneous changes

Some other miscellaneous things were also added/fixed/enhanced such as the enhancing TFS integration or adding support for the CTRL+A keyboard shortcut in the method body editor was added.


We would love to hear your feedbacks, don’t hesitate to share your feedbacks on our forums or by commenting this post!



Carl Anderson