[TYPO3-mvc] SOAP call using extbase

Martin Kutschker masi-no at spam-typo3.org
Tue Apr 20 08:24:40 CEST 2010


Bernhard Kraft schrieb:
> Jochen Rau wrote:
> 
>> So wrapping the "ProcedureCall" with a Domain Service would fit best
>> IMO as there is no persistence aspect.
> 
> Hello !
> 
> I have to admit that I do not have much clue about the whole stuff. I
> got it working using the MVC concept. Right now I create my second
> extbase extension which features a classical database repository. But I
> have not digged enough into what you call a "Domain Service".
> 
> If I understood the Repository concept correctly, you define a domain
> class which is an interface representing the entities of your data
> model. Then the repository makes methods like "store", "delete",
> "retrieve", etc. available which accept or deliver instances of the
> domain class? Correct?

Yes.

> But what would a domain service be?

Anything you need. A service is a class that isn't an entity, but provides an API to perform tasks.
In your case it will do SOAP calls.

> One could think of this as a repository. Where I call a
> "findCard(cardNumber)" method. But this is just a simple example. I do
> not really see from the blog example how I could query a repository (or
> SOAP service) for something requiring more parameters. Like
> "isCardValid" with parameters "cardNumber", "expirationDate" and
> "CVC-Number" like it is common for credit card transactions ...

isCardValid() doesn't belong to a repository. Though you could have a findValidCards() method in the
repository or a isValid() method in your model.

If you want to be pragmatic you can add isCardValid($no,$expDate,$cvc) perhaps as a static method to
the model or, as you suggested, to the repository. Conceptually it belongs to neither of them.

> PS: I rather like to always have some real world examples instead of
> knocking down each others heads with patterns, factories and other stuff
> sounding like some pieces of 19th century industrialization ;)

One of the idea of patterns is to have a common name for code structures. If everybody knows the
patterns its easier to discuss matters. But I agree that to get things started examples are most
welcome (the books about patterns usually supply them).

Masi


More information about the TYPO3-project-typo3v4mvc mailing list