-
Notifications
You must be signed in to change notification settings - Fork 0
Ecosoft MVC Design
Sunny edited this page Jul 4, 2019
·
1 revision
The Model View Controller (MVC) design pattern will specify our application to consist of a data model, presentation view, and control information that binds the model to the view. In the following wiki, each section will specify the design between each module.
User
Class User {
int uid
String password
String realName
Score score
List<Goal> goals
Garden garden
Set<User> friends
Set<User> friendRequests
AbstractSettings settings
bool sendFriendReq()
void acceptFriendReq()
User removeFriend()
Set<User> abstractGetSortedFriends()
}
Goal
Class AbstractGoal {
String description
ActivityType activityType
Date completedDate
}
Activity
Enum ActivityType { ... }
Class AbstractActivity {
ActivityType activityType
Date completedDate
int activityValue
int abstractValueToPoints()
}
Score
Class Score {
Map<ActivityType, List<AbstractActivity>> activityList
List<AbstractActivity> getActivity()
int getTotalScore()
int getActivityScore()
}
Garden
Class Garden {
List<AbstractPlant> plants
}
Enum PlantType {
PLANT(price)
int getPrice()
}
Class AbstractPlant {
PlantType plantType
Date plantDate
}
Settings
Class AbstractSettings { ... }
Articles
Class Articles {
String title
String description
String url
Date date
List<User> likes
}
User Database
Class UserDatabase {
Map<String, User> userdb
bool addNewUser()
bool userExist()
User removeUser()
User getUser()
}
Article Database
Class ArticleDatabase {
Map<String, Article> articledb
bool addNewArticle()
Article removeArticle()
Article getArticle()
}
Creating Users
Class UserCreator {
String getTermsOfService()
void sendVerification()
bool usernameAvailable()
bool passwordAcceptable()
bool correctVerification()
void hashPassword()
User createUser()
}
Login Users
Class UserLogin {
bool userAuthenticated()
}
userNameField
passwordField
loginBtn
signUpBtn
userNameField
passwordField
phoneNoField
ToSCheckBox
ToSModal
signUpNextBtn
verificationField
createUserBtn
homeNavBtn
activitiesNavBtn
socialNavBtn
profileNavBtn
newsFeedLinkBtn
newsFeedLikeBtn
activityBtn
activityDropDown
leaderboardList
addFriendBtn
searchFriendField
searchUserField
requesteFriendBtn
removeFriendBtn
settingsBtn
pointsBtn
userDetailBtn
privacySettingsBtn
upgradeMembershipBtn
shopBtn
loginUser()
signUpUser()
validUserName()
validPassword()
validPhoneNumber()
validVerification()
completeSignUp()
renderHomePage()
renderActivityPage()
renderSocialPage()
renderProfilePage()
redirectLink()
addLike()
redirectActivity()
sortLeaderboardBy()
searchFriend()
redirectAddFriendPage()
searchOtherUser()
sendFriendRequest()
acceptFriendRequest()
deleteFriend()
redirectSettings()
redirectStats()
As part of the MVC design, the following specifies the project structure and directory.
|ProjectEcosoft
|_app
|_build
|_libs
|_src
|_test
|_main
|_java
|_model
|_user
|_goal
|_activity
|_score
|_garden
|_settings
|_articles
|_databases
|_view
|_login
|_signup
|_navbar
|_home
|_activities
|_social
|_profile
|_statistics
|_settings
|_control
|_login
|_signup
|_navbar
|_home
|_activities
|_social
|_profile
|_statistics
|_settings
|_res
|_gradle
|External Libraries