Enterprise patterns with functional programming

Is there any good source of (centralized) information about enterprise architecture patterns (a la Fowler's), maybe with examples and use cases and a fair amount of practical information? For example, I have seen many of the design patterns of GoF all shortly explained in some SO posts and other sites, as well as practical information related to them. I'm asking for an analogous resource from a more functional paradigm oriented to enterprise applications.

Thanks.


I'm asking for an analogous resource from a more functional paradigm oriented to enterprise applications.

There's no resource that I'm aware of. Large scale enterprise use of modern FP is often < 10 years old, so resources tend to be in internet form. Also, a lot of people avoid the GoF as largely irrelevant to FP.

SO remains your best bet (here's an example: https://stackoverflow.com/a/3077912/83805 ). There's a market for an FP architectures book though, that's for sure.


Editorial

In my experience, almost all designs fall into the 'compiler' or 'interpreter' pattern, using a model of the data and functions on that data. That is, problem domains are represented as algebraic structures (objects as ADTs with functions over them), and software architectures are about mapping from one algebra to another. This is the "category theory" design pattern(!)

Our algebraic data types are the best way of capturing structures. Functions are the best way to transform these structures, or map them to new types of structures. And there's lots of research on writing compilers and interpreters that makes this stuff easy. You can implement most systems by writing a compiler (or interpreter). So learn to write compilers.

It's quite amazing how many things fall out as interpreters or compilers, when you start looking for these "categoric" software problems. Things like MVCs fall out as interpreters. A lot of business software (data munging) becomes parser+analysis+pretty printer -- ie a compiler. Maybe it is obvious that architectures (ie how to glue components) is really about algebras and categories.

Obviously this is about high level architectures. Lower level things, like how best to implement a logging systems, or how best to wire up expensive components, how to pass environments around, replay/rollback do have particular abstractions that you can reuse are a different problem. Often monoids/monads/applicatives or other computational notions captured as libraries.

Again though, we go to the algebraic view to find the structure that best captures the problem domain.

链接地址: http://www.djcxy.com/p/42868.html

上一篇: 努力使用纯函数式编程来解决日常问题

下一篇: 具有功能编程的企业模式