[Arp] Multiple xml file services
christophe_herreman at hotmail.com
Fri Apr 22 23:39:19 PDT 2005
>Would you just add multiple services with addService or would you use one
>service and then manually load in the other xml files as you need them
>in the code?
You can use it both ways.
Say you have a menu.xml and a news.xml.
1. You could create a menuService and a newsService, add them in the
ServiceLocator and use them in 2 different commands. That way, you have 2
seperate services which makes it cleaner to work with. They contain less
code and are easier to maintain.
2. You could also create 1 service (e.g. siteService), change the path to
the XML in your commands and call different methods on it. The (latest)
version I have contains a setPath() and setBasePath() method.One possible
drawback of this is that all the methods that will parse the XML will be in
the same class. This could lead to large classes.
It's up to you to decide, but in this case I would recommend the first
In our case (e-learning apps), we have tons of xml files that need to be
loaded. One example is that of assessments and assessmentitems. We have 2
services for this, AssessmentService and AssessmentItemService. When we
request them in our commands, we change their path using setPath() and call
the desired method on them. We use setBasePath() in our serviceLocator. E.g.
assessmentService.setBasePath("../xml/") (in reality we do some more checks
on _url, etc). From there on, we don't have to worry if the path will be
correct, we only have to change the name of the xml file we need.
Hope this helped you.
----- Original Message -----
From: "Mark Walters" <driverjase at gmail.com>
To: <Arp at ariaware.com>
Sent: Friday, April 22, 2005 9:26 PM
Subject: [Arp] Multiple xml file services
This might be directed towards Christophe ... or anyone else familiar
with the xml service, but I was wondering how you would go about
setting up your ServiceLocater to use multiple xml files. Would you
just add multiple services with addService or would you use one main
service and then manually load in the other xml files as you need them
in the code?
Thanks in advance,
Arp mailing list
Arp at ariaware.com
More information about the Arp