gpt4 book ai didi

java - 非 RAM 存储

转载 作者:行者123 更新时间:2023-12-02 07:39:25 24 4
gpt4 key购买 nike

我正在从Bruce Eckel“Thinking In Java”学习Java。我无法理解非 RAM 存储的概念。

正如书中所说:

Non-RAM storage. If data lives completely outside a program, it can exist while the program is not running, outside the control of the program. The two primary examples of this are streamed objects, in which objects are turned into streams of bytes, generally to be sent to another machine, and persistent objects, in which the objects are placed on disk so they will hold their state even when the program is terminated. The trick with these types of storage is turning the objects into something that can exist on the other medium, and yet can be resurrected into a regular RAM-based object when necessary. Java provides support for lightweight persistence,and mechanism such as JDBC!

什么是轻量级持久性?..将对象转变为可以存在于其他介质上,但在必要时可以复活为常规的基于 RAM 的对象意味着什么?

最佳答案

持久数据是指比创建它的程序更长寿的信息。大多数复杂程序都使用持久数据:GUI 应用程序需要跨程序调用存储用户首选项,Web 应用程序需要长时间跟踪用户移动和订单等(来源如下)

这是您问题的答案:轻量级持久性是一个需要开发人员做很少工作或不需要做任何工作的存储区域。示例:Java 序列化是一种轻量级持久化形式,因为它可以轻松地将 Java 对象直接持久化到文件中。

我很高兴您不只是阅读这本书......而是针对您在书中遇到的任何内容提出问题。祝你好运

source

关于java - 非 RAM 存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17048235/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com