所有应用程序的一种保存方法 [英] One Save Method for All Application

查看:134
本文介绍了所有应用程序的一种保存方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为整个应用程序编写一个Save方法。任何链接或想法??

I want to write one Save method for the whole application. Any link or idea ??

推荐答案

从本质上讲,你不能 - 没有人知道应用程序将要保存什么,它是如何保存的或者在哪里。



想想像Visual Studio这样的复杂应用程序:它必须保存SLN文件(XML),PRJ文件(XML),. CS(文本) ,.VB(文本),调试信息(PDB),中间文件(OBJ),可执行文件(EXE),类库(DLL),本机可执行文件(EXE,但不同),本机类库(DLL,但又不同),等等。



只有你知道你的应用程序试图保存什么:它可能是单个文件的平面数据,它可能是适合数据库的关系数据。我们不知道。



所以你需要坐下来,找出你需要保存的东西,然后开始考虑最合适的数据表格来保存它们。然后问一下,如果你还有疑问。但我们不能为你做到这一点!
In essence, you can't - nobody has any idea what the application is going to be saving, how it needs to be saved, or where.

Think about a complex app like Visual Studio: It has to save SLN files (XML), PRJ files (XML), .CS (Text), .VB (Text), Debug info (PDB), intermediate files (OBJ), executables (EXE), Class libraries (DLL), native executables (EXE, but different), Native class libraries (DLL, but different again), etc., etc., etc..

Only you have any idea what your application is trying to save: it could be "flat" data on a single file basis, it could be relational data that is suitable for a Database. We have no idea.

So you need to sit down, work out what you need to save, and then start thinking about the most appropriate data forms to save them in. Then ask about that, if you still have questions. But we can't do that for you!


这篇关于所有应用程序的一种保存方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆