Giter Site home page Giter Site logo

hnlxl / ddddemo-im-server Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 486 KB

An instant messaging system's server side that demonstrates Java domain-driven development. 一个演示Java 领域驱动开发的即时通信系统的服务器端。

License: Apache License 2.0

Java 100.00%

ddddemo-im-server's People

Contributors

hnlxl avatar

Watchers

 avatar

ddddemo-im-server's Issues

核心特性:即时通信

特性

提供核心的即时通信功能,以便于:

  • 完成最小的可演示功能,为后续开发打基础
  • 演示Netty的使用
  • “长连接”类型的用户接口/适配器,在依赖倒置架构中的位置

初步分解

  • 作为一个用户,我想与另一个用户聊天,以便于与其一对一沟通。
  • 作为一个用户,我想与固定的一群用户做聊天,以便于在认识的人之间做多人沟通。
  • 作为一个用户,我想与临时的多个用户做聊天,以便于临时性的多人沟通。

相关

无需提前建设用户模型,因为即时通信聚合中涉及到的用户,是值对象,并不是对用户聚合的引用。

消息暂不考虑设计成链表结构

单独的链表结构可以做,但跟JPA/Hibernate结合起来的链表结构还没有经验,将聚合与链表结构结合起来也没有经验。由于该项目的重点是DDD演示而不是IM服务器,故当前不再考虑这种设计。以后如果有机会,在进行重构优化。

不断言NULL Do not assert NULL

如果断言NULL,会增加很大的单元测试工作量,所以不做此项工作。

It will increased big unit testing workload to assert NULL, so I will not do this.

不予考虑代理主键,所有主键均为广义自然键

注: 广义自然键包含,像UUID和序列号这些,额外添加但对用户可见的特殊属性。

纯粹为性能服务的代理主键,若要实现,需要引入层超模型和Hibernat自然键,还是挺麻烦的,超出该项目的开发目的,故当前对此不予考虑。

另一方面,所有主键,使用最简单的生成策略,不在资源库中为其设计生成方法。 例如:UUID类型主键通过直接调用 java.util.UUID.randomUUID() 来获取(但是应当在模型层生成,不应该由应用服务来生成),整数型主键则使用数据库的自动增长方式来生成。此外,由于聚合ID必须手动生成(详见下文 ),故它的内部值,全部使用UUID而不是整数。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.