I am developing an application in which subscriber send SMS to get any package.
In my program, when I received user request, I have to create Subscriber object. To initialize subscriber object, I have to query back-end database and IN node then set attributes of subscriber object.
Please suggest for this, should I use Factory pattern or Builder? or any good alternative? whats suggestions for putting my code for querying database and calling XMLRPC in Factory class?
My class look like following
public class Subscriber {
private String subno;
private String subPackageType;
private String subTariff;
private String subRequest;
private boolean isTransferable;
}
Now subno,subRequest i got from sms, subPackageType from database and subTariff from IN node by sending XMLRPC command.
I have more attributes as well but i just mention some to provide concept.
Regards,
imran