Archive

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) 
) 
AS 
SET NOCOUNT ON 
SELECT DISTINCT [Test].[Test_Id], [Test].[Test_Name] 
    FROM [Test] 
    WHERE ([Test].[Test_Name] LIKE (@Name + '%'))

RETURN

And the Oracle Database Producer will generate the following equivalent:

PROCEDURE LoadByName(CF_CURSOR OUT "Sample"."CF_#Runtime".CF_CURSOR_TYPE, 
        "#Name" NVARCHAR2) AS 
    V_CF_CURSOR "Sample"."CF_#Runtime".CF_CURSOR_TYPE; 
    BEGIN 
        OPEN V_CF_CURSOR FOR 
        SELECT "Test"."Test_Id", "Test"."Test_Name" 
            FROM "Sample"."Test" 
            WHERE ("Test"."Test_Name" LIKE ("#Name" || N'%')); 
    CF_CURSOR := V_CF_CURSOR; 
    END;

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.

 

Cheers,
Carl Anderson

SoftFluent Team at DevWeek London!

March 26, 2012 Leave a comment

2012_devweek

DevWeek 2012 kicked-off this morning with great workshops and as announced previously: we’re there!

Starting tomorrow, come have a chat with us at our booth!

 

Cheers,

Carl Anderson

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)

Cheers,

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!

Example:

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.

 

Cheers,

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.

 

Cheers,

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

 

Cheers,

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" />
    </cf:enumeration>

(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 (http://forums.softfluent.com/default.aspx?g=posts&t=395).

 

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!

 

Enjoy,

Carl Anderson

CodeFluent Entities: Added SQL Server 2012 support!

March 16, 2012 1 comment

Microsoft recently released to manufacturers its latest version of Microsoft SQL Server (Microsoft SQL Server 2012) and good news for our users: CodeFluent Entities supports SQL Server 2012!

No changes to your projects are needed:

  • just generate over again your persistence layer (this time pointing on your brand new SQL Server 2012 server!),
  • update your application so it uses the new persistence layer,
  • Taaadaaaa, you’ve just migrated your app to SQL Server 2012, cool right?!!

 

image

Note: Did you know SQL Server Management Studio 2012 is now in a Visual Studio 2010 Shell?!!

Prerequisites to do this are as usual:

 

Cheers,

Carl Anderson

LogToMail

March 15, 2012 Leave a comment

As part of the SoftFluent product team, I’m proud to officially announce our new product: LogToMail!

LogToMail is a light program (the whole thing is less than 1 MB), which can run as a Windows Service or in command line, and which monitors the event log of a server.

 

Whenever a new entry is logged, it can send an email with the content of the log entry to the appropriate person.

 

Defining which type of entries should trigger an email (all by default) and to whom (default is the administrator email specified at installation time) can be done through the configuration file of the tool. To be more precise, rules are defined using the JavaScript language.

For instance, the following rule sends an email to user1, user2 and user3, when an error log event other than the 1058 and 1126 is written to the event log:

<rule name="SendToUsers" sendFrom="logtomail@softfluent.com" sendTo="user1@example.com,user2@example.com,user3@example.com" sendFromDisplayName="LogToMail '#::Environment.MachineName#'">
    (Event.EventType == 1)  &amp;&amp; (Event.EventCode != 1058) &amp;&amp; (Event.EventCode != 1126)
</rule>

We’ve actually been using this tool internally for years to ensure we don’t miss issues on our servers; it turned out to be so useful that we thought it might help others than us Winking smile

There’s a free evaluation version (limited to 30 days) which is available here if ever you want to try it out Smile

 

Hope this helps,

Carl Anderson

Dates and JSON

March 7, 2012 Leave a comment

JSON (JavaScript Object Notation) is a lightweight text-based open standard designed for human-readable data interchange (source: Wikipedia).

JSON is so very handy but one thing I hate about JSON is that its spec is so lightweight that it sometimes lacks some details on specific areas such as for dates. Scott Hanselman’s post “On the nightmare that is JSON Dates. Plus, JSON.NET and ASP.NET Web API”, is actually a perfect example of the kind of troubles you run into when building web sites and using various JSON serializers.

We bumped into this as we’re working on the next version of our ASP.NET Web Producer which will ship with an Ajax web site template (JQuery + JqGrid + JSON/REST) allowing developers to generate business oriented web apps (see our roadmap post for more info on this subject).

Anyway, when developing a business web site we, developers, have to support dates and since their format can vary in JSON, our JSON serializer/deserializer class (named JsonUtilities) supports several:

So if ever you need to support several date formats without having to switch JSON serializers/deserializers for each scenario, keep this JsonUtilities class in a corner as I’m sure it’ll come handy.

By the way, this JsonUtilities class is shipped as part of a free NuGet package, independently from our product, named CodeFluentRuntimeClient.

Here’s it’s web page if you want to try it out (http://nuget.org/packages/CodeFluentRuntimeClient) and here’s a post containing some serialization examples (JsonUtilities – Part 2) Winking smile

 

Cheers,

Carl Anderson

Follow

Get every new post delivered to your Inbox.

Join 41 other followers