kx197
kx197

Reputation: 41

How to design a 3-tier .NET enterprise application using only F#?

I am about to undertake a major design of a business critical application in a complex financial trading domain. The technology, which is not open for discussion, is:

I would like to use a standard 3-tier architecture with the majority of the code in the middle layer for the business rules, logic, models, etc. The UI code should be only to enrich the user experience and perhaps for some simple syntax validation of user inputs.

Has anybody experience of building a 3-tier enterprise application with F#?

How applicable are the typical MS architectural blueprints for F#?

FYI: F# is chosen because of previous success using Haskell for modeling complicated domains. In addition to the widely documented advantages of functional languages.

Upvotes: 1

Views: 510

Answers (3)

Petr
Petr

Reputation: 4280

I think the question is too broad but you can find a good start at fsharp.org

You can start from section 'Guides'-'Enterprise Programming' where you could find recommendation on F# enterprise app architecture. See also fsharp community projects where you can find type providers and other useful libraries.

You definitely can use F# at any of 3 tiers but it also plays nicely with other .NET languages. For example for WPF UI layer you could use C# based XAML view and F# ViewModel

Upvotes: 2

sgtz
sgtz

Reputation: 9019

I am aware of F# being used successfully with each of technologies listed, and in each of the business areas (logic, rules, and models). I'd suggest you are well placed to judge the functional benefits and considerations from your Haskell experience.

You can see a few testimonials over here. As you'll appreciate, the people behind some of the really interesting uses of F# (modelling, etc), aren't allowed to publicly say they even used F#, let alone what they used it for. There are some exceptions to this rule, and occasionally you'll find a white paper. Try to get to a user group meeting.

Specifically, which models would you like to implement in F#? Just kidding. I don't expect an answer ;-) It's a bit like that.

SO is not really the place to go in depth on architecture though.

Upvotes: 1

Isaac Abraham
Isaac Abraham

Reputation: 3512

You shouldn't have many problems with that.

There are several technologies you can use to access SQL, from the usual choices of ADO .NET, Entity Framework or Dapper etc. to SQL type providers that wrap around those including the SqlClient and the SQLProvider.

From the point of view of WPF, you have IMHO two choices - first choice is a standard WPF XAML approach which will force you to use a C#/ VB .NET project for the code-behind, and then you ViewModel (and everything underneath) in F#. Alternatively you can use one of the XAML Type Providers e.g. FsXaml which allow you to have everything in F#.

For consuming data such as WCF, OData and XML etc. there are a rich set of type providers which will be infinitely less painful than the standard code-generation approach in C# and VB .NET.

Don't forget testing frameworks as well - you can use the usual ones like NUnit and XUnit, as well as a set of wrappers around them like FSUnit and Unquote which give you even more power.

Upvotes: 3

Related Questions