Domain Modeling Made Functional - Scott Wlaschin

preview_player
Показать описание
Statically typed functional programming languages encourage a very different way of thinking about types. The type system is your friend, not an annoyance, and can be used in many ways that might not be familiar to OO programmers.

Types can be used to represent the domain in a fine-grained, self documenting way. And in many cases, types can even be used to encode business rules so that you literally cannot create incorrect code. You can then use the static type checking almost as an instant unit test — making sure that your code is correct at compile time.

In this talk, we'll look at some of the ways you can use types as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.

NDC Conferences
Рекомендации по теме
Комментарии
Автор

One of the best talks I’ve heard on functional programming in practice.

dupersuper
Автор

One of my colleagues often says that Scala is the only language that brings functional programming into the industry. I just sent this to him.

protaties
Автор

Fantastic video. I am a C# developer and already try to follow some functional principles thanks to people like Vladimir Khorikov, and am already trying to avoid primitive obsession, but to do that in C# is so verbose. But your video now make me want to move from C# to F#. I am loving the type safety of it.

dibley
Автор

But we would eventually need to throw an exception when the create functions return null, wouldnt we? Wouldnt it be better then throw as close as possible to the actual root cause, so from within the create function? We also avoid repetition.

CZGamingU
Автор

Isn't a type chane going to send out ripples across the codebase? This will make feature addition or modification difficult.

PTM
Автор

Right at the beginning, as soon as I see "FirstName MiddleInitial LastName" I hope "PLEASE this time let the 'domain modelling expert' tell us first thing that this is a stunningly BAD representation for names, because if he doesn't know what the issues are in modelling names, why should I believe he knows anything else about domain modelling?"
- What about people who use their 2nd name instead of the 1st?
- What about people like my father who use their 3rd name (out of 4) rather than the 1st or 2nd?
- What about people who only have one name?
- What about people with multipart surnames like "Ní Dhónaill" or "Bean Uí Mhurchú " or "van der Pol"?
- What about people like Hungarians and Chinese who want their family name to be written first? (There is a distinction between First name and Given name.)
- What about people with names that can be written in two different scripts, where the collation order differs between the scripts and the name should be recognised as the same name whichever script it's in (I'm thinking of chinese characters and Pinyin here)?
Names are HARD and we shouldn't be reinforcing bad ways to deal with them.

richardokeefe
Автор

This verified email thing looks over complicated, especially with private constructor..

michunel
Автор

Someone in the audience is hacking a lung instead of F#

bobweiram
Автор

Great but a bit scary : not all cultures have multiple names, never glue lego pieces together 🙂

rolfnoduk
Автор

why every talk about FP has a guy coughing the entire video??? hahahaha

lucasa
Автор

"In real world we need to deal with databases"
Please upgrade your database

souenzzo