Java File Upload Service Design
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
I am creating an application that will upload a file in the web. There are three services: login, upload and logout. All of it sends request and receives response which I put in a DTO. Model has all the logic, while view has the UI. Controller connects the model and view.
Above are the fields inside its respective DTO. Is there a better way to do this? As you can see, the fields are repeating, but varies whether it is on request or response.
I created two interfaces and its respective DTO implements it.
First:
public interface TransferrableKey extends TransferrableData
public String getLogonkey();
public void setLogonkey(String logonKey);
public String getTokenkey();
public void setTokenkey(String tokenKey);
Second:
public interface TransferrableResponse extends TransferrableData
public String getMessage();
public void setMessage(String message);
public String getResponse();
public void setResponse(String response);
UploadRequestDTO.java
public class UploadRequestDTO implements TransferrableKey
private String logonKey;
private String tokenKey;
/**
* @return the logonkey
*/
public String getLogonkey()
return logonKey;
/**
* @param logonKey the logonkey to set
*/
public void setLogonkey(String logonKey)
this.logonKey = logonKey;
/**
* @return the tokenkey
*/
public String getTokenkey()
return tokenKey;
/**
* @param tokenKey the tokenkey to set
*/
public void setTokenkey(String tokenKey)
this.tokenKey = tokenKey;
UploadResponseDTO.java
public class UploadResponseDTO implements TransferrableData, TransferrableResponse, TransferrableKey
private String response;
private String message;
private String logonKey;
private String tokenKey;
/**
* @return the response
*/
public String getResponse()
return response;
/**
* @param response the response to set
*/
public void setResponse(String response)
this.response = response;
/**
* @return the messages
*/
public String getMessage()
return message;
/**
* @param message the messages to set
*/
public void setMessage(String message)
this.message = message;
/**
* @return the logonkey
*/
public String getLogonkey()
return logonKey;
/**
* @param logonKey the logonkey to set
*/
public void setLogonkey(String logonKey)
this.logonKey = logonKey;
/**
* @return the tokenkey
*/
public String getTokenkey()
return tokenKey;
/**
* @param tokenKey the tokenkey to set
*/
public void setTokenkey(String tokenKey)
this.tokenKey = tokenKey;
java object-oriented design-patterns
add a comment |Â
up vote
0
down vote
favorite
I am creating an application that will upload a file in the web. There are three services: login, upload and logout. All of it sends request and receives response which I put in a DTO. Model has all the logic, while view has the UI. Controller connects the model and view.
Above are the fields inside its respective DTO. Is there a better way to do this? As you can see, the fields are repeating, but varies whether it is on request or response.
I created two interfaces and its respective DTO implements it.
First:
public interface TransferrableKey extends TransferrableData
public String getLogonkey();
public void setLogonkey(String logonKey);
public String getTokenkey();
public void setTokenkey(String tokenKey);
Second:
public interface TransferrableResponse extends TransferrableData
public String getMessage();
public void setMessage(String message);
public String getResponse();
public void setResponse(String response);
UploadRequestDTO.java
public class UploadRequestDTO implements TransferrableKey
private String logonKey;
private String tokenKey;
/**
* @return the logonkey
*/
public String getLogonkey()
return logonKey;
/**
* @param logonKey the logonkey to set
*/
public void setLogonkey(String logonKey)
this.logonKey = logonKey;
/**
* @return the tokenkey
*/
public String getTokenkey()
return tokenKey;
/**
* @param tokenKey the tokenkey to set
*/
public void setTokenkey(String tokenKey)
this.tokenKey = tokenKey;
UploadResponseDTO.java
public class UploadResponseDTO implements TransferrableData, TransferrableResponse, TransferrableKey
private String response;
private String message;
private String logonKey;
private String tokenKey;
/**
* @return the response
*/
public String getResponse()
return response;
/**
* @param response the response to set
*/
public void setResponse(String response)
this.response = response;
/**
* @return the messages
*/
public String getMessage()
return message;
/**
* @param message the messages to set
*/
public void setMessage(String message)
this.message = message;
/**
* @return the logonkey
*/
public String getLogonkey()
return logonKey;
/**
* @param logonKey the logonkey to set
*/
public void setLogonkey(String logonKey)
this.logonKey = logonKey;
/**
* @return the tokenkey
*/
public String getTokenkey()
return tokenKey;
/**
* @param tokenKey the tokenkey to set
*/
public void setTokenkey(String tokenKey)
this.tokenKey = tokenKey;
java object-oriented design-patterns
Welcome! Code Review is about reviewing existing code for improvements, thus you shouldn't ask a question with no code (or non-working code) here. You can edit your question to provide the code you have already written if it's working properly. Otherwise, you should look for another site in the stack exchange.
â Ronan Dhellemmes
Jan 24 at 10:51
@RonanDhellemmes I have updated my post.
â Cian
Jan 24 at 11:12
There's still no code to review. Only classes with getters and setters and some interfaces.
â slowy
Jan 26 at 11:05
Because those getters and setters are the codes that I am requesting for review.
â Cian
Jan 26 at 12:08
If you look on the table, the fields are just repeating. My question is if there is any other way to do this, so that they are not repeatable. As for now, I created an interface for it.
â Cian
Jan 26 at 12:11
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am creating an application that will upload a file in the web. There are three services: login, upload and logout. All of it sends request and receives response which I put in a DTO. Model has all the logic, while view has the UI. Controller connects the model and view.
Above are the fields inside its respective DTO. Is there a better way to do this? As you can see, the fields are repeating, but varies whether it is on request or response.
I created two interfaces and its respective DTO implements it.
First:
public interface TransferrableKey extends TransferrableData
public String getLogonkey();
public void setLogonkey(String logonKey);
public String getTokenkey();
public void setTokenkey(String tokenKey);
Second:
public interface TransferrableResponse extends TransferrableData
public String getMessage();
public void setMessage(String message);
public String getResponse();
public void setResponse(String response);
UploadRequestDTO.java
public class UploadRequestDTO implements TransferrableKey
private String logonKey;
private String tokenKey;
/**
* @return the logonkey
*/
public String getLogonkey()
return logonKey;
/**
* @param logonKey the logonkey to set
*/
public void setLogonkey(String logonKey)
this.logonKey = logonKey;
/**
* @return the tokenkey
*/
public String getTokenkey()
return tokenKey;
/**
* @param tokenKey the tokenkey to set
*/
public void setTokenkey(String tokenKey)
this.tokenKey = tokenKey;
UploadResponseDTO.java
public class UploadResponseDTO implements TransferrableData, TransferrableResponse, TransferrableKey
private String response;
private String message;
private String logonKey;
private String tokenKey;
/**
* @return the response
*/
public String getResponse()
return response;
/**
* @param response the response to set
*/
public void setResponse(String response)
this.response = response;
/**
* @return the messages
*/
public String getMessage()
return message;
/**
* @param message the messages to set
*/
public void setMessage(String message)
this.message = message;
/**
* @return the logonkey
*/
public String getLogonkey()
return logonKey;
/**
* @param logonKey the logonkey to set
*/
public void setLogonkey(String logonKey)
this.logonKey = logonKey;
/**
* @return the tokenkey
*/
public String getTokenkey()
return tokenKey;
/**
* @param tokenKey the tokenkey to set
*/
public void setTokenkey(String tokenKey)
this.tokenKey = tokenKey;
java object-oriented design-patterns
I am creating an application that will upload a file in the web. There are three services: login, upload and logout. All of it sends request and receives response which I put in a DTO. Model has all the logic, while view has the UI. Controller connects the model and view.
Above are the fields inside its respective DTO. Is there a better way to do this? As you can see, the fields are repeating, but varies whether it is on request or response.
I created two interfaces and its respective DTO implements it.
First:
public interface TransferrableKey extends TransferrableData
public String getLogonkey();
public void setLogonkey(String logonKey);
public String getTokenkey();
public void setTokenkey(String tokenKey);
Second:
public interface TransferrableResponse extends TransferrableData
public String getMessage();
public void setMessage(String message);
public String getResponse();
public void setResponse(String response);
UploadRequestDTO.java
public class UploadRequestDTO implements TransferrableKey
private String logonKey;
private String tokenKey;
/**
* @return the logonkey
*/
public String getLogonkey()
return logonKey;
/**
* @param logonKey the logonkey to set
*/
public void setLogonkey(String logonKey)
this.logonKey = logonKey;
/**
* @return the tokenkey
*/
public String getTokenkey()
return tokenKey;
/**
* @param tokenKey the tokenkey to set
*/
public void setTokenkey(String tokenKey)
this.tokenKey = tokenKey;
UploadResponseDTO.java
public class UploadResponseDTO implements TransferrableData, TransferrableResponse, TransferrableKey
private String response;
private String message;
private String logonKey;
private String tokenKey;
/**
* @return the response
*/
public String getResponse()
return response;
/**
* @param response the response to set
*/
public void setResponse(String response)
this.response = response;
/**
* @return the messages
*/
public String getMessage()
return message;
/**
* @param message the messages to set
*/
public void setMessage(String message)
this.message = message;
/**
* @return the logonkey
*/
public String getLogonkey()
return logonKey;
/**
* @param logonKey the logonkey to set
*/
public void setLogonkey(String logonKey)
this.logonKey = logonKey;
/**
* @return the tokenkey
*/
public String getTokenkey()
return tokenKey;
/**
* @param tokenKey the tokenkey to set
*/
public void setTokenkey(String tokenKey)
this.tokenKey = tokenKey;
java object-oriented design-patterns
edited Jan 24 at 11:10
asked Jan 24 at 9:16
Cian
717
717
Welcome! Code Review is about reviewing existing code for improvements, thus you shouldn't ask a question with no code (or non-working code) here. You can edit your question to provide the code you have already written if it's working properly. Otherwise, you should look for another site in the stack exchange.
â Ronan Dhellemmes
Jan 24 at 10:51
@RonanDhellemmes I have updated my post.
â Cian
Jan 24 at 11:12
There's still no code to review. Only classes with getters and setters and some interfaces.
â slowy
Jan 26 at 11:05
Because those getters and setters are the codes that I am requesting for review.
â Cian
Jan 26 at 12:08
If you look on the table, the fields are just repeating. My question is if there is any other way to do this, so that they are not repeatable. As for now, I created an interface for it.
â Cian
Jan 26 at 12:11
add a comment |Â
Welcome! Code Review is about reviewing existing code for improvements, thus you shouldn't ask a question with no code (or non-working code) here. You can edit your question to provide the code you have already written if it's working properly. Otherwise, you should look for another site in the stack exchange.
â Ronan Dhellemmes
Jan 24 at 10:51
@RonanDhellemmes I have updated my post.
â Cian
Jan 24 at 11:12
There's still no code to review. Only classes with getters and setters and some interfaces.
â slowy
Jan 26 at 11:05
Because those getters and setters are the codes that I am requesting for review.
â Cian
Jan 26 at 12:08
If you look on the table, the fields are just repeating. My question is if there is any other way to do this, so that they are not repeatable. As for now, I created an interface for it.
â Cian
Jan 26 at 12:11
Welcome! Code Review is about reviewing existing code for improvements, thus you shouldn't ask a question with no code (or non-working code) here. You can edit your question to provide the code you have already written if it's working properly. Otherwise, you should look for another site in the stack exchange.
â Ronan Dhellemmes
Jan 24 at 10:51
Welcome! Code Review is about reviewing existing code for improvements, thus you shouldn't ask a question with no code (or non-working code) here. You can edit your question to provide the code you have already written if it's working properly. Otherwise, you should look for another site in the stack exchange.
â Ronan Dhellemmes
Jan 24 at 10:51
@RonanDhellemmes I have updated my post.
â Cian
Jan 24 at 11:12
@RonanDhellemmes I have updated my post.
â Cian
Jan 24 at 11:12
There's still no code to review. Only classes with getters and setters and some interfaces.
â slowy
Jan 26 at 11:05
There's still no code to review. Only classes with getters and setters and some interfaces.
â slowy
Jan 26 at 11:05
Because those getters and setters are the codes that I am requesting for review.
â Cian
Jan 26 at 12:08
Because those getters and setters are the codes that I am requesting for review.
â Cian
Jan 26 at 12:08
If you look on the table, the fields are just repeating. My question is if there is any other way to do this, so that they are not repeatable. As for now, I created an interface for it.
â Cian
Jan 26 at 12:11
If you look on the table, the fields are just repeating. My question is if there is any other way to do this, so that they are not repeatable. As for now, I created an interface for it.
â Cian
Jan 26 at 12:11
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f185858%2fjava-file-upload-service-design%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Welcome! Code Review is about reviewing existing code for improvements, thus you shouldn't ask a question with no code (or non-working code) here. You can edit your question to provide the code you have already written if it's working properly. Otherwise, you should look for another site in the stack exchange.
â Ronan Dhellemmes
Jan 24 at 10:51
@RonanDhellemmes I have updated my post.
â Cian
Jan 24 at 11:12
There's still no code to review. Only classes with getters and setters and some interfaces.
â slowy
Jan 26 at 11:05
Because those getters and setters are the codes that I am requesting for review.
â Cian
Jan 26 at 12:08
If you look on the table, the fields are just repeating. My question is if there is any other way to do this, so that they are not repeatable. As for now, I created an interface for it.
â Cian
Jan 26 at 12:11