Originally posted by Murat Balkan:
Hi all,
Should I include a POJO for interaction with the TransMaster in the class diagram? Or should it be represented in the component diagram?
Thanks,
Murat
The TransMaster represents the API that the application must use to validate and process the customer's credit card.
You could look for this API as an service the your travel application is going to consume. The service term used here represents the operational functions that some system access of another system (subsystem).
So, give that the TransMaster is just one subsystem and will provides some kind of service to your application,
you should design some kind of piece of interaction between the systems.
This means that you can design a class or DTO to identify the parameters that must be passed from your travel application to transmaster core API.
For example, if you incept that the transmaster must require two parameters of processing (The customer credit card number, and the ammount to debit), you could plan some design like this:
[has] [ref]
Customer -----------> CreditCard ------------> [CreditCardType]
-------- ---------- --------------
Name, Age number, expireDate creditCardName
birthDay
[TransMasterMessage]
--------------------
creditCard [ref to CreditCard]
double ammount
The 'TransMasterMessage' could represents the parameters data that must be passed to the TransMaster subsystem, and some controller object will pick up the object to assembly a parameters passing to the API. The method could be something like this:
public class TransMasterInterfaceBO {
// The stub object could be injected by a IoC framework ...
private TransMasterStub tms;
public boolean processRequest(TransMasterMessage tmm, double ammount) {
// extract the valuable paramaters from the object ...
String creditCardNumber = tmm.getCreditCard().getNumber();
double _ammount = ammount;
//
tms.processCreditCard(creditCardNumber, _ammount);
}
}
Well, that's are my souths!