tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/1164-where-to-keep-a-initxml-and-configas-fileRobotlegs: Discussion 2012-10-23T10:43:47Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/198443772012-10-20T05:40:43Z2012-10-20T05:40:43ZWhere to keep a Init.xml and Config.as file ?<div><p>I have an init.xml file. That is used by Config.as file. (
Init.xml and Config.as are later on loaded by StatsModel ) . Both
the files ( init.xml and Config.as) contain the "screen-messages".
Difference is that some are good to be allowed for the user to
modify it, while some others are good for the programmer only to
modify it.</p>
<p>For example :<br>
User can modify, the background skin or say fonts used etc.<br>
While programmer may modify the in-application messages like
error-messages, server-file-locations etc.</p>
<p>Right now i keep both the files Init.xml and Config.as besides
the "main" swf generated. The reason is it's very handy to make all
such changes in one go.</p>
<p>My query is, does keeping the files ( especially Config.as )
besides the main.swf seem to be ok ? Or there is some better place
to keep it following the MVC ?</p>
<p>Thankyou!</p></div>vishwas.gagranitag:robotlegs.tenderapp.com,2009-10-18:Comment/198443772012-10-20T08:18:41Z2012-10-20T08:18:41ZWhere to keep a Init.xml and Config.as file ?<div><p>My take on this:</p>
<p>Init.xml file is an external resource. A service (InitService)
loads it and passes the (parsed) xml on to a Model or other class
that needs it.</p>
<p>I’d put Init.xml under a folder
‚resources/data’ or 'resources/config' and Config.as
under ‚models’ or under ‚config’ together
with the RobotlegsConfig.as (context configuration), depending on
what exactly the Config.as is supposed to do.</p>
<p>The names of the folders are up to you.</p>
<p>=<strong>resources</strong>:</p>
<p>--------<strong>data</strong> (or config)</p>
<p>--------------<em>Init.xml</em></p>
<p>--------assets</p>
<p>--------------SomeImage.png</p>
<p>--------styles</p>
<p>--------------SomeCss.css</p>
<p>=<strong>yourdomain</strong></p>
<p>--------config</p>
<p>--------------RobotlegsConfig.as (context configuration)</p>
<p>--------------(Config.as)</p>
<p>--------controllers</p>
<p>--------<strong>models</strong></p>
<p>--------------StatsModel</p>
<p>--------------<em>Config.as</em></p>
<p>--------services</p>
<p>-------------InitService.as</p>
<p>--------views</p></div>Ondina D.F.