开发者

If using Functional Oriented Programming does the "impedance mismatch" go away?

I see a lot of work at the moment on Entity Modelling in Code and interest in functional Programming. After some years working in Object Oriented Systems I have time and time again come up against the "Impedance Mismatch".

Since Transact SQL implements some FOP with datasets being described as Sets in a declarative way, does the "impedance mismatch" go away. If this is the case, which I am trying to ascertain, is there a need for the Domain Model being developed in code or is it ok to use the old and tried techniques of SQL and relational theory.

I know there is a big push in writing Entity Layers and ORMS at the moment to try and mitigate this imp开发者_C百科edance mismatch and get systems to work as Objects.

Does this work around reflect that there may be a bigger issue at hand and the "Impedance mismatch" is a lot more concerning for Object Oriented Design/Programming in that the whole paradigm might not be the best solution when dealing with RDBMS interactions.

I am thinking of the implications of moving from c# over to f#, full time and for all code bases. I think that I might have a problem with shifting my mind set.


No

That is the short answer. Yet functional programming "patterns" will reduce the impedance mismatch. But only expect this after much time spent learning the functional style. Expect also your OO style impedance mismatch to improve with that same gained wisdom.

Functional programming teaches you how to work out the relations between data and functions just like you would resolve a soduko puzzle. The functional style gives you key knowledge to understand why many of the impedance mismatches happen. Yet even with this knowledge, the impedances still happen. They happen because programming is about mapping trees and graphs into lists and trees. It is about mapping "higher level" constructions (both in a data and functional "space") into "lower level" mappings. Each mapping may work well until a new requirement comes in and causes trouble, needing then the mappings to be revisited. That's life.

Still only functional programming is "pure" enough to provide the clarity to understand how and why these mismatches happen. Therefore, if you want to master software architecture, you should invest as much time and effort you have to learn functional programming.


If you don't map relational data to objects (Don't use ORM) only then does the impendance mismatch go away, your programming style does not matter as much.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜