有关特定XML设置的建议: [英] Advice on specific XML setup:

查看:80
本文介绍了有关特定XML设置的建议:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对XML的东西相当新,但是他们已经做了很多阅读。我有一个特定的应用程序,我很沮丧如何最好地设置它。该应用程序用于机器设置配方。以下是一些基本的业务规则。


- 配方现在将存储在xml中,第2阶段将是一个数据库。


- 目前我使用一个xml用于所有食谱,但是为每个食谱配备一个文件可能更好???


- 每个食谱分为一个或多个过程


- 每个过程分为一个或多个组。


- 每个组有几个设置(或参数)


- 设置可以是不同的数据类型。


------------------------------- ----------------------------------------------


当前XML设置:


< Recipe_Table>


  <食谱ID ="">


     <流程ID ="">


        <群组ID ="">


            <设定ID = QUOT;设置1"> VALUE1< / Settting>


&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; <设定ID = QUOT;设置2">值2< / Settting>


&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < setting id =" setting3"> value3< / Settting>


----------------------- ---------------------------------------------


Q1:由于我的设置属于不同的数据类型,我不知道如何在我的架构中处理它。我很想做以下事情,但我不知道它是不是好形式。


         < Group id ="">


             <设定1的id ="设置1"> VALUE1< /设定1>


&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ; <设置2 ID = QUOT;设置2">值2< /设定2>


&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ; < Setting3 id =" setting3"> value3< / Setting3>


 


Q2:最好为每个食谱提供xml文件或一个巨大的xml文件?


问题3:后来,当我进入数据库时​​,让数据库生成一个xml文件是相当简单的,所以我不必更改我的当前的"ReadRecipeFromXml"类?如果是这样,我必须采取什么预防措施?


 


谢谢


SteveJ

解决方案

为什么不将收件人存储在数据库中?我不确定为什么Xml是这里的要求......如果你打算将它移到数据库中为什么你需要使用Xml这个中间步骤?


Pawel 


I'm fairly new to the XML stuff, but have been doing a lot of reading. I've got a particular application and I am torn on how to best set it up. The application is for machine setup recipes. Here are some of the basic business rules.

- The recipes will be stored in xml for now, stage 2 will be a database.

- Currently I am using one xml for all recipes, but it might be better to have a file for each recipe???

- Each recipe is divided one or more processes

- Each process is divided into one or more groups.

- Each group has several settings (or parameters)

- Settings can be of different data types.

-----------------------------------------------------------------------------

Current XML setup:

< Recipe_Table >

  < Recipe id="">

     < Process id="">

        < Group id="">

            <Setting id="setting1">value1</Settting>

            <Setting id="setting2">value2</Settting>

            <Setting id="setting3">value3</Settting>

--------------------------------------------------------------------

Q1: Since my settings are of different data types, I don't know how to deal with that in my schema. I'm tempted to do the following, but I don't know if it is good form.

         <Group id="">

             <Setting1 id="setting1">value1</Setting1>

             <Setting2 id="setting2">value2</Setting2>

             <Setting3 id="setting3">value3</Setting3>

 

Q2: Better to have xml file per recipe or one giant xml file?

Q3: Later, when I go to database, it is fairly straight forward to have the database generate an xml file, so that I don't have to change my current "ReadRecipeFromXml" class? If so, what precautions do I have to take?

 

Thanks


SteveJ

解决方案

Why not just store the recipies in the database? I am not sure why Xml is a requirement here... If you plan to move it to the database why do you need this intermediate step with Xml?

Pawel 


这篇关于有关特定XML设置的建议:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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