Here in my project i receive a xml file, in which the flow of the project is decided, my project contains video player to play video files, a audio recorder to record voice and a application form to get information regarding the user, but here the flow is completely dynamic each time i receive an xml in which the next screen to display is not fixed.
在我的项目中,我收到一个xml文件,其中决定了项目的流程,我的项目包含播放视频文件的视频播放器,录制语音的录音机和获取用户信息的申请表,但这里是每次我收到一个xml,其中下一个要显示的屏幕不固定时,flow是完全动态的。
Here i know to parse the xml but i have to know which collection structure is good to store and retrive (collection structure such as mutablearray, mutabledictionary, plist, or sqlite) else can i use beans or any other method is there please help me.
在这里,我知道解析XML,但我知道它集合结构是很好的存储和retrive(馆藏结构如mutablearray,mutabledictionary,plist中或SQLite的),我还可以使用豆类或任何其他方法有请帮助我。
Thanks...
谢谢...
1 个解决方案
#1
0
I would say implementing "beans" that are logically sound with your flow logic, then have a mapper maps the XML to the beans (create beans base on the XML). This way you decouple your flow logics from the XML file format, so later on if you decide to use JSON or the XML file format changes, all you have to do is to change the mapper.
我会说用流逻辑实现逻辑上合理的“bean”,然后让mapper将XML映射到bean(基于XML创建bean)。这样您就可以将流逻辑与XML文件格式分离,因此,如果您决定使用JSON或XML文件格式更改,稍后您需要做的就是更改映射器。
#1
0
I would say implementing "beans" that are logically sound with your flow logic, then have a mapper maps the XML to the beans (create beans base on the XML). This way you decouple your flow logics from the XML file format, so later on if you decide to use JSON or the XML file format changes, all you have to do is to change the mapper.
我会说用流逻辑实现逻辑上合理的“bean”,然后让mapper将XML映射到bean(基于XML创建bean)。这样您就可以将流逻辑与XML文件格式分离,因此,如果您决定使用JSON或XML文件格式更改,稍后您需要做的就是更改映射器。