PROJECT: Media Socializer


Overview

Media Socializer is a one-stop social media desktop application used to help social media users keep track of all the social media platforms their contacts are using. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

Summary of contributions

  • Major enhancement: Added the ability to manage the social media platforms of each person

    • What it does: Allows the user to add the associated social media platforms to the specified person by typing in the links to the relevant profile pages or remove them by entering the names of the platforms.

    • Justification: This feature improves the product significantly because a user can have the application keep track of all the social media profiles of their contacts.

    • Highlights: This enhancement affects the overall feel of the product, since it is a core feature of the application. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required touching upon multiple components to properly realise such a feature.

  • Minor enhancement: Added a sort command that allows the user to alphabetically sort the people in the list.

  • Code contributed: [Functional code] [Test code]

  • Other contributions: Assisted team members in fulfilling certain requirements for the milestones (Pull requests #70, #99)

    • Project management:

      • Managed releases v1.5rc - v1.5 (2 releases) on GitHub

      • Identified the deliverables for each release to keep track of

    • Enhancements to existing features:

      • Updated the GUI to show social media icons for each person (Pull request #85)

      • Wrote tests for existing features to maintain coverage above 90% (Pull requests #87, #140)

    • Documentation:

      • Updated appendix of the Developer Guide to match the goals of the application: #45

      • Added tags to the User Guide and Developer Guide to link portfolios to their associated sections: #69

    • Community:

      • PRs reviewed (with non-trivial review comments): #56, #32

      • Bug reports followed up with testers (examples: 1, 2)

      • Reported bugs and suggestions for other teams in the class (examples: 1, 2)

Contributions to the User Guide

Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

Sorting all persons : sort [Since v1.2]

Sorts all persons in the address book alphabetically and then displays the current list in sorted order.
Format: sort

Adding social media platforms to a person : addplatform [Since v1.3]

Adds social media platforms to an existing person in the address book by providing the associated profile links.
Format: addplatform INDEX [l/LINK]…​

  • Adds the social media platforms by editing the person at the specified INDEX. The index refers to the index number shown in the last person listing. The index must be a positive integer 1, 2, 3, …​

  • Existing values will be updated to the input values.

  • During this operation, the existing platform links of the person that are unchanged will be retained i.e adding of platforms is cumulative.

  • You may only store a single link for each social media platform.

  • You can remove all the person’s social media platforms by typing l/ without specifying any links after it.

Valid Facebook Link Forms Valid Twitter Link Forms
  • https://www.facebook.com/<profile username>

  • https://facebook.com/<profile username>

  • http://www.facebook.com/<profile username>

  • http://facebook.com/<profile username>

  • www.facebook.com/<profile username>

  • facebook.com/<profile username>

  • facebook.com/profile.php?id=<user profile id>

  • https://www.twitter.com/<username handle>

  • https://twitter.com/<username handle>

  • http://www.twitter.com/<username handle>

  • http://twitter.com/<username handle>

  • www.twitter.com/<username handle>

  • twitter.com/<username handle>

It is not guaranteed that the link provided leads to an available page. Links are accepted so long as they match any of the patterns as defined above. This feature will be improved to test for broken/removed pages in future releases.

Examples:

  • addplatform 1 l/www.facebook.com/johndoe
    Adds the Facebook platform with the link www.facebook.com/johndoe to the 1st person.

  • addplatform 2 l/
    Clears all existing social media platforms of the 2nd person.

Removing stored platforms of a person : removeplatform [Since v1.4]

Removes the specified social media platforms of the stated person.
Format: removeplatform INDEX [smp/PLATFORM]…​

  • Removes the social media platforms by editing the person at the specified INDEX. The index refers to the index number shown in the last person listing. The index must be a positive integer 1, 2, 3, …​

  • You can remove all the social media platforms of a person by not specifying any platform fields.

  • Unrecognised platforms will be ignored during execution.

Examples:

  • removeplatform 1
    Removes all social media platforms tied to the 1st person.

  • removeplatform 2 smp/twitter
    Removes the Twitter platform from the 2nd person.

Contributions to the Developer Guide

Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project.

Appendix A: Product Scope

Target user profile:

  • has a need to keep track a significant number of social media platforms of contacts

  • has a need to view the latest scoop of various people’s social life

  • prefer desktop apps over other types

  • can type fast

  • prefers typing over mouse input

  • is reasonably comfortable using CLI apps

Value proposition: one-stop access to multiple social media platforms

Feature Contribution:

Assignee Major Minor

Seunghwan Choi

  • Updating the UI to show multiple social pages on the application window:

    • With all the links to the different social media pages of a person stored in the user’s address book, the user can view all of the pages in a single window under collapsible tabs (to distinguish the different social media platform pages) when he/she selects the particular person. This simplifies the process of providing the user with his/her daily social media fix.

  • login function:

    • Allows the user to login to all the available social media platforms as given by the application. This feature is essential so that users can perform their required tasks, such as accessing their friends list and viewing the social feeds of friends.

Chuang Cheng Heng

  • search function:

    • Allows user to perform the search action on all the social media platforms available with a single command. This feature improves the product significantly because a user can do search on the application instead of going to the individual social media platform and repeatedly perform the search.

  • findtag command:

    • Allows the user to find persons whose tags contain the input keywords. This can assist users in filtering out people who only use a certain social media platform if they are tagged.

Tan Wei Jie

  • Manage social media platforms of persons function:

    • Allows user to manage the social media platforms of each person through the addplatform and removeplatform commands. This feature allows a user to have the application keep track of all the links to the social media profiles of each person in the address book so that he/she can easily access their profile pages when selected.

  • sort command:

    • Allows the user to sort the address book list alphabetically. This feature organises and arranges the list for easier viewing and searching.

Appendix B: User Stories

Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *

Priority As a …​ I want to …​ So that I can…​

* * *

new user

see usage instructions

refer to instructions when I forget how to use the App

* * *

user

add a new person

* * *

user

delete a person

remove entries that I no longer need

* * *

user

find a person by name

locate details of persons without having to go through the entire list

* * *

user

see the page of the specified platform of a person

get information of the person with my preferred social media platform

* * *

user

delete one of social media platforms of a person

remove entries that I no longer need

* * *

user

find a person by name with the specified platforms

locate details of persons who have the social media platforms without having to go through the entire list

* * *

user

apply the filter of a social media platform

have a list of persons who are on the platform shown

* * *

user

apply multiple filters regarding social media platforms

have a list of persons who satisfy the filters shown

* * *

user

clear filters applied

get information regardless of them

* * *

social media user

select a person and see the social media platforms they are using

have the option not to go to the various platforms to check

* * *

social media user

store the links to the profiles of a person (friend)

have the app keep track of it for me

* * *

social media user

view the latest feed/status of a person

get up-to-date information about them

* * *

lazy social media user

log out from all my social media account with one command

remove potential unauthorised access effectively

* * *

social media user

log in to my account

access private profiles in my friend list

* * *

social media user

search for profile in all social media platforms with the same command

* * *

social media user

send friend request from the app

* * *

social media user

be able to react to a post (like, comment, etc) from the app directly

* * *

lazy user

be able to remain logged in to my account

* * *

social media user

post and update my statuses

let people know what I’m up to

* *

user

hide private contact details by default

minimize chance of someone else seeing them by accident

* *

advanced user

use shorter versions of a command

type a command faster

* *

user

have the information of my social media accounts encrypted

keep my personal information safe

* *

user

add a new person with private contact details

keep them in secret

* *

user

search a person with the tags

* *

careless user

logout from all my account remotely

ensure my account security will not be compromised in case I lose my device

* *

social media user

be able to customize what is displayed (profile, social media in use, or latest feed/status) when I select a person

personalise the app to my liking

* *

careful user

have an additional authentication system for editing my profile setting

* *

social media user

be able to download files (e.g. images or documents) posted by others

keep a copy and view them offline

* *

social media user

send messages to the people on my friends list

communicate with them

* *

social media user

add people found in my friends list on social media to my address book

create contacts of them and communicate through other means

* *

social media user

find my friends that are near my location

meet up and have fun with them

* *

user

set up planned events with a group of my friends

remember their details and be punctual for them

* *

user

be reminded of important events (e.g. movie outings, birthday celebrations)

be prompted not to miss them

*

user with many persons in the address book

sort persons by name

locate a person easily

Sort feature

Current Implementation

The sort mechanism is facilitated by the SortCommand and is used for sorting all persons found in the address book by name alphabetically. It inherits from UndoableCommand and thus supports the undo/redo mechanism, enabling the ability to reverse the command and return the address book to its previous unsorted state.

When the user executes the SortCommand using the command word sort, the current list of persons shown in the GUI will be retained. As illustrated, a filtered list of persons will be displayed in a sorted manner once the command is executed:

SortFilteredListDiagram

The command can also handle multiple persons with similar names (i.e. different letter-casings) as shown below:

SortSimilarNamesDiagram

During sorting, names of two different persons are compared using the static method, nameComparator, found in the person class:

public static Comparator<Person> nameComparator() {
    return Comparator.comparing((Person p) -> p.getName().toString(), (
        s1, s2) -> (s1.compareToIgnoreCase(s2) == 0) ? s1.compareTo(s2) : s1.compareToIgnoreCase(s2));
}

As seen, casing is ignored when names are first compared with each other. The usual lexicographical order will instead be used when encountering identical names.

The following sequence diagram shows how the sort operation works:

SortCommandSequenceDiagram

Design Considerations

Aspect: Implementation of SortCommand
  • Alternative 1 (current choice): Create a custom sorting method for person names

    • Pros: Allows list to be displayed in a uniform manner, such that similar names are also sorted.

    • Cons: Requires extra work to write custom method.

  • Alternative 2: Utilise String.CASE_INSENSITIVE_ORDER for sorting

    • Pros: Does not require additional work to write or override compare methods.

    • Cons: List may be inconsistent when sorting multiple persons with similar names.

Aspect: Implementation of Custom Sorting Method
  • Alternative 1 (current choice): Use comparators and create one for person names called nameComparator

    • Pros: Potentially enabling the ability to sort different fields other than names.

    • Cons: May be more difficult to write.

  • Alternative 2: Implement comparable and override the compareTo method in person class

    • Pros: Simpler to understand.

    • Cons: Can only define a single sorting sequence when comparing two different persons.

Aspect: Display of person list in GUI
  • Alternative 1 (current choice): Retain the current list of persons as shown in GUI but shown in a sorted manner

    • Pros: User would not have to key in the command to filter the list after sorting.

    • Cons: User may think that only the current list is sorted.

  • Alternative 2: Displays the list of all persons found in the address book sorted alphabetically

    • Pros: More properly describes what sort actually does by showing the full list of persons sorted.

    • Cons: Current list is replaced by showing all persons.

Add Platform feature

Current Implementation

The add platform function makes use of a factory to facilitate the creation of various social media platforms. A platform is created only when users provide a valid profile link; this object will be associated to the particular person found in the list as specified by the user. Currently, only the Facebook and Twitter platforms are available.

The structure of the class diagram is as shown:

SocialMediaPlatformFactoryClassDiagram

As seen, a client can make use of the SocialMediaPlatformFactory to deal with the creation of social media platform objects without the need of specifying the concrete class to construct. Thus, it follows the factory pattern since the creation logic is abstracted away by the factory. The difference here to other implementations of the pattern is the use of an abstract class, SocialMediaPlatform, instead of the usual interface.

In order to properly utilise the factory, a client needs to provide some form of specification:

public final class SocialMediaPlatformFactory {
    // ... class variables, constructor ...

    public static SocialMediaPlatform getSocialMediaPlatform(String type, Link link) throws IllegalValueException {
        // ... social media platform instance creation logic ...
    }
}

From the extract, a String data type and a Link object need to be provided by the caller when using the getSocialMediaPlatform method. The method will then return an instance of the available concrete classes.

The AddPlatformCommand makes use of the implementation of EditCommand as the foundation, editing the Person model to include the newly created social media platforms. Each platform is stored as an entry to the person’s platform map, with the key being the name of the platform. An example is shown below as an illustration:

SocialMediaPlatformMapObjectDiagram

The links provided by the user will be parsed within the AddPlatformCommandParser to convert them into Link objects. From there, AddPlatformCommand will create a new map and add the relevant social media platforms by calling the getSocialMediaPlatform method of SocialMediaPlatformFactory for object creation. To merge the updates with the targeted person, the command would also retrieve all of its information in order to create a new Person object before replacement is done. The sequence of the events is as follows:

AddPlatformCommandSequenceDiagram

In the UI Component, the PersonCard will be updated to show the icons of the platforms added. Suppose the user want to add a Facebook profile to the first person. The AddPlatformCommand would be executed using the addplatform command word. As illustration, the user has successfully added a Facebook platform to the targeted person by typing addplatform 4 l/www.facebook.com/david:

AddPlatformToPersonDiagram

Since the basis of AddPlatformCommand is heavily inspired by the EditCommand, interactions between the various components is exactly the same:

AddPlatformCommandHighLevelSequenceDiagrams

Design Considerations

  • Alternative 1 (current choice): Create social media platform objects with the links as attributes and store into a map

    • Pros: High potential of implementing methods for interactions between the actual profile page using the corresponding API.

    • Cons: Accessing and inputting of data will be more complex.

  • Alternative 2: Store using a set of links

    • Pros: Ease of access to data.

    • Cons: Can only be used for the displaying of pages, no room for other implementations.

Aspect: Usage of Interface or Abstract Class
  • Alternative 1 (current choice): Have SocialMediaPlatform be an abstract class

    • Pros: Allows common methods to be used by classes that extends from it and still provide a means of ensuring critical methods that are abstract be implemented.

    • Cons: Classes that want to make use of the implementations can only extend from it.

  • Alternative 2: Have SocialMediaPlatform be an interface

    • Pros: Higher flexibility for classes since they can implement many interfaces.

    • Cons: Limitations in sharing and utilisation of default methods between classes.