I'm building a system that uses objects that are built using multiple Async queries to a remote server (Firebase) and queries to a local DB.
How should I design a module to generate these objects?
I was thinking of using a Builder Pattern but almost all of these variables will be received individually from separate DB queries and not specified in a .build() call.
Example of object:
public class ContactUserObject {
//The userID to identify the user in the system (gotten from network call)
private final String contactUserID;
//The contact's phone number; (found locally)
private final String contactPhoneNumber;
//The public display name; (gotten from Firebase)
private final String contactPublicDisplayName;
//Name of contact in phone; (found locally)
private final String contactLocalDisplayName;
//Public contact profile picture
private final Bitmap contactCustomProfilePicture;
}
reference for more detail: http://arvindthirumurthy.com/creational-patterns-for-user-object-creation/