Skip to content

Code to review Raimondi#3

Open
EdoardoRaimondi wants to merge 43 commits into
code-reviewfrom
CodeReview-Raimondi
Open

Code to review Raimondi#3
EdoardoRaimondi wants to merge 43 commits into
code-reviewfrom
CodeReview-Raimondi

Conversation

@EdoardoRaimondi

Copy link
Copy Markdown
Contributor

Classes to review: WebDictionary -> Key, SMSKey, SMSNetDictionary, SMSNetDictionarySupport, Test

matteocarnelos and others added 30 commits November 6, 2019 15:25
Dictionary created in a new module for the Dictionary demo
Created Serializable interface
Created Resource interface
Created skeleton of a basic SMSResrouce
Added Basic Unit Tests for Dictionary
Demo crash fix: app crash on start
Created basic test for network usage
Added basic Network implementation (missing of some functions)
Re-added Permission Requests
… if no peer is online (instead of null)

Fixed ListView on simulator display
Started updates on net control
…t in the dictionary)

ConcatAll method added
Some specifics addition
Thanks to enums now requests are 1 char long instead of many
Implemented Net update notification: when 2 nets join they get both sides notified about the new people on the net
BugFix: special characters getting added to the net
BugFix: 2 SMSPeers with the same number now return true on .equals()
BugFix: 2 SMSPeers with the same number now return the same hashCode()
BugFix: 2 SMSPeers with the same number added to the same hashMap are now considered the same SMSPeer
BugFix: updateNet skipping the first input number to add to the dictionary
BugFix: concatAll now concatenates arrays if one of them is null; if both are null it returns null
Improved concatAll specifics
Added Test cases for these bugs
…sing Object instead of String. Consequent methods and classes adaptation.
Cogno-Marco and others added 12 commits November 15, 2019 11:27
SMSCore_Tests cleanup and fix
SMSCore_Tests cleanup and fix
Added permissions in smslibrary Manifest
Lightly improved code comments on NetworkConnection
Implemented some methods to get network info (ex. if the network is empty and how many peers are online)
Implemented some methods to add peers to the network
BugFix: fixed nullPointerException during Net creation if myPeer was passed as null
Improved code specifics
Improved functions visibility
Implemented inviteToJoin method
Made some methods more robust by adding checks
Implemented sendPing method
Implemented (and tested)removePeer functions (input SMSPeer, SMSPeer[] and String)
Improved specifics on some methods
Improved code on some methods
added regions to separate code blocks
improved functions/classes visibility
@EdoardoRaimondi EdoardoRaimondi self-assigned this Nov 17, 2019
@EdoardoRaimondi
EdoardoRaimondi changed the base branch from master to code-review November 17, 2019 17:05
@tonin-alessandra

Copy link
Copy Markdown

Really good code, good overall formattation with correct use of spaces and alignements.
Variables and methods names are explicative and they respect camelCase formattation.
Methods and classes are well divided, with methods doing only one operation.
No hardwiring, except for a little thing in Tests class: you use a lot of times the string "photo.png", should it be a constant to avoid this little hardwiring?
Good code coverage and really nice idea to use @see for Android test documentation.
I have only two suggestions:

  • SMSNetDictionarySupport, lines 22 and 26: the description of what method returns is redundant, you wrote twice the same thing;

  • In all your dictionary code you should use generic parameters such as K, R instead of Key and Resources objects: in this way, your code will be more generic and more reusable.

I have no other suggestions, really good work, keep coding like this!

SerializableObject class created
All SMSNetworkDictionary methods adaptation

@Martignago98 Martignago98 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello sig. Raimondi,
I have reviewed your code.
The code is readable and the formatting is nice and respects the camelCase convention, maybe some other comment could have helped to read better the code.
Operations within the method are few and elemental so that it easy to understand and to change it later, good.
In my opinion, you could be more descriptive in the specifications, obviously being careful not to overdo it, mostly in the class SMSNetDictionary on @param and @return description.
I didn't see hardwiring and that it is excellent.
For the Test, you should test also the SMSNetDictionarySupport class.

All in all the code is not bad at all, and it presents several opportunities to improve.

* @return Array containing all the elements of param's arrays; null if both arrays are null,
* the other array if only one is null
*/
protected static SMSResource[] concatAll(SMSResource[] array1, SMSResource[] array2) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have changed the name of this method to concatArrays

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants