Comments (3)
自从把做了8年的j2ee 系统改造到 clojure . 越来越觉得,面向对象是个不好的方向.
- 面试近五六百人, "把工作中常用到的设计模式说下", 几乎没用.
- 系统由团队来开发,不同的人/小组 开发不同的模块, 独立开发、独立部署, 用面向对象来统一,会死板,僵化.
- 单元测试 用面向对象**来写,好像带着一个枷锁.
- 函数式编程 + 微服务, 每个模块的写法规范比较好统一, 多个数据库 crud 全面分装为底层api. 核心流程,封
装为高级api . 这样只要有api的权限,随时随地都可以在自己模块编写代码,而不影响整个系统的其他模块(https://github.com/marick/Midje 这个写单元测试 非常好用)
网上到处都是喷各大公司代码各种烂的问题,究其原因,是因为大家对于写好代码关注或实践的比较少了,面向对象是适合解决复杂问题域交叉耦合,假如遇到的场景很简单,用面向对象反倒感觉是大炮打蚊子了,
一个单元测试,实在没有必要用面向对象来写,我们在做的时候,application层的对外服务,严格意义上讲也不是面向对象的呢,只是核心的领域层,用了面向对象**,一个单点,一般是不太用的。我们实践下来,发现以往都是用一些比较教条的**在实践,但是又是一个必经之路。照本宣科->怀疑其可用性,方便性->推翻,基于实践改良。
不同团队开发,划分好领域,定义好协议(api)即可。以上是个人意见,可以交流下**
from cola.
同样的,设计模式的精髓,其实是要深入使用,理解才能够明白其中三味的,但是很多新人实践较少,或者很刻意的去用一下,偶尔还会过度设计,这些是需要对技术基础进行积累的,这就是高级开发工程师和初级的区别
from cola.
面向对象和函数式编程可以结合使用
from cola.
Related Issues (20)
- Client 这个包同时被domain,和app依赖,但是client的实现是app 这个看着有点费解?请帮忙解惑 HOT 4
- TransitionsBuilderImpl and TransitionsBuilderImpl should have a hierarchical relationship, not an inheritance relationship
- 看了很多架构,发现都没有针对每一层的“DTO”进行设计说明 HOT 1
- Extension 注解传值
- 关于domainservice应当如何理解?
- Command Handler VS Application Service VS Domain Service HOT 1
- 关于COLA的使用问题 HOT 2
- 关于event的问题
- 各位老师,请问使用cola-archetype-web生成的工程和介绍的有些不一样 HOT 1
- 关于状态机是否可在线更新 HOT 1
- 是否考虑 Go 版本的生成工具 HOT 1
- 正在学习状态机组件,内部流转功能在什么场景下使用? HOT 2
- 一些工具类和全局常量等,比如MD5Utils,JSONUtils,DateUtils,这些放在哪一层module呢? HOT 1
- 怎么保证在分布式场景下,状态机修改状态线程安全呢
- cola开发交流群
- 如何表达领域和子域的关系呢?领域的gateway可以调用子域的gateway吗
- 微信业务之类的第三方介入组件应该放在哪一层 HOT 2
- extension-starter与spring boot 3不兼容 HOT 1
- maven 打包后,执行 jar 包报错 no main manifest attribute, in start/target/start-1.0.0-SNAPSHOT.jar
- cola-component-statemachine 是否支持设置并行节点? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cola.