Frage

In the book 'ActionScript Developer’s Guide to Robotlegs' it is said that services should use parsers for transforming data. In which package should I put a parser for a service in com.stackoverflow.services.fooService?

War es hilfreich?

Lösung

There is no strict rule in this, what works well for you.
A possible setup could be:

besides:
com.stackoverflow.control
com.stackoverflow.event
com.stackoverflow.model

you could have:
com.stackoverflow.remote

with another split up according the different API's which are used (divided according to endpoints + type e.g. JSON/AMF/SOAP/...)

com.stackoverflow.remote.api -> own back-end
com.stackoverflow.remote.twitterapi

from there you can go further:
com.stackoverflow.remote.api.service
OR
com.stackoverflow.remote.api.resource
com.stackoverflow.remote.api.host -> endpoint setup, security,... to inject in the service class
com.stackoverflow.remote.api.parser -> data parsers

Additionally you could include a control package to include the commands to configure the api (setup events, hosts, injection for parsers,...) and how it integrates to the main context.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top