Giter Club home page Giter Club logo

Comments (8)

drakeet avatar drakeet commented on July 29, 2024

这是一个重要的可选接口,提供了 Content 的序列化方案,使得 Content 能够转为 byte[] 存储于数据库中,详情可以看我的 TimeMachine 应用:

MessageStore.java#L196

TimeMachine 是我另一个项目,其中的 transformer 模块使用了 Google 的 Agera 和我的 MultiType.

from multitype.

drakeet avatar drakeet commented on July 29, 2024

实现了 SavableTextContent:

https://github.com/drakeet/TimeMachine/blob/master/timemachine/src/main/java/me/drakeet/timemachine/message/TextContent.java

通过 Savable,我们可以把任意 Item (可能包含不同的 ItemContent 子类对象),统一存储到一个数据库表中,不需要新增字段也不需要修改表结构。

from multitype.

ErQi avatar ErQi commented on July 29, 2024

谢谢解答,我想我需要去把你的TimeMachine项目去分析一遍才能理解其重要性.

from multitype.

drakeet avatar drakeet commented on July 29, 2024

简单说,Savable 使得我们能够不修改数据库字段和表结构的情况下,容纳任意类型数据,这和 MultiType 的设计初衷是一样的:做一个新需求,不需要修改任何旧的代码,只要增加新代码即可。

from multitype.

ErQi avatar ErQi commented on July 29, 2024

谢谢,也就是说这接口主要是针对于对本地存储的兼容性所设计,在不考虑本地存储的情况下是否使用该接口并不影响.
这样么?

from multitype.

drakeet avatar drakeet commented on July 29, 2024

它是一个可选接口,如果你不需要存储,或者想自己设计存储方案,完全可以无视它、不必实现它。

from multitype.

ErQi avatar ErQi commented on July 29, 2024

谢谢解答,我想我理解其设计含义了.

from multitype.

drakeet avatar drakeet commented on July 29, 2024

这个接口将在 2.2.0 正式版中删除,感谢反馈。

from multitype.

Related Issues (20)

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.