Giter Club home page Giter Club logo

agents_i3a's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

uo250970 asw-i3a

agents_i3a's Issues

Change the hardcoded age to a dynamic one

Assert.assertEquals(27, userInfo.getAge());

.andExpect(jsonPath("$.age", is(27)))//Born in 1996

.andExpect(jsonPath("$.age", is(27)))//Born in 1996

The 27 should be be a dynamic age. Else test will fail when actual time changes as the .getAge() calculates the age as currentTime - birthday.

Refactor code

The new requirements does not longer has users only as actor of the system, therefore I believe the classes should be ranamed.
Also the new specification for the master CVS is different. Therefore at the moment we have useless attributes (Birth, nationality, ... ) on our User class so we should clean them from the sourcecode.

Proposal:

  • Rename "User" to "Agent"
  • Rename "UserInfo" to "AgentInfo"
  • Rename "UserInfoAdapter" to "AgentInfoAdapter"
  • Remove dateOfBirth, nationality and address from "User"(Agent) class

Update Documentation

From the issue #35 we get to the point that we have to update the documentation of the project. Let's make a brain storm on how to do it.

Modify REST JSON response

Some JSON fields from the old implementations must be modified or replaced by others in order to match the new requirements.

Old JSON response:

{
 "firstName": Nombre, 
  "lastName": Apellidos, 
  "age": Age (will be obtained from user's birth date and current time)
  "ID": User ID, 
  "email": email 
}

New JSON response:

{
 "name": Name,
 "location": Coordinates (optional),
 "email": Email
 "id": identifier,
 "kind": agent's kind,
 "kindCode": numeric code that represents the kind,
}

Changes needed:

  • Join firstName and lastName into a single one (name)
  • Remove age field
  • Add location field
  • Add kind field
  • Add kindCode field.

Workaround IOException throwing

When updating the kind of an Agent it is needed to throw an IOException from the domain model package which may not be a very good practice.
A possible solution may be to rethrow the IOException as other exception. However we'll need to figure out where to place this new exception and in which level it is thrown.

Cached version of kind

The new implementation of kind #14 is perfect, however dealing with files any time getKind() is called may have low performance
Instead it may be done as a private access only field which updates only whenever kindCode is updated (In the constructor and in setKind() )

Add agents kind to REST query.

For the REST web service that allows to query info about an agent the input must be changed from

{"login": user, "password": password}

to

{"login": user, "password": password, "kind":kind}

Notice that the kind field is new and its representation is an integer number that represents the agent's kind. The keyword identifier comes from a master CVS file that contains 2 fields separated by commas, where first field is the numeric code and the second one is the name of the user kind. For example:

1,Person
2,Entity
3,Sensor

If the agents kind name changes in the master file the system must be able to resolve the new ones

Please change the format of the readme and update.

In the pull #47 the readme was modified by adding this line:
curl -H "Content-Type: application/json" -X POST -d '{"login":"45170000A","password":"4[[j[frVCUMJ>hU", "kind":1}' http://localhost:8080/user

Please format it between to be like this:

curl -H "Content-Type: application/json" -X POST -d '{"login":"45170000A","password":"4[[j[frVCUMJ>hU", "kind":1}' http://localhost:8080/user

Here is a hint of hoy to do it:

```bash
curl -H "Content-Type: application/json" -X POST -d '{"login":"45170000A","password":"4[[j[frVCUMJ>hU", "kind":1}' http://localhost:8080/user
```

Change the Kind uploaded in #6

Notice that #6 that in theory is fix of #5 uses an enum for person entity and sensors, if tomorrow this changes in the cvs file and 1 mean cars is a problem. Fix to be completely live. Each time that is need to get a kind Code look for it in the cvs file.
Example:

public String toString() {
    ...
    "Kind" + CSVFile.getKindForCode(1); // Will return an String containing "Person".
    ...
}

Ensure that there is no constriction to change the hole cvs file in execution time.
So then this Kind.class does not need to exists.

public enum Kind {

Add JDoc to all the code

Added JDoc to the code should be mandatory, i will add it to the existing code but please for new upload add a little of documentation for future developers

P0001-use-participants-i2b-as-source

Use participants-i2b as source project

Introduction

The project participants-i2b
seems to be a perfect starting point to refactor and implement the required
functionality of I3A2.

Motivation

As described during the last lab lecture the team has to select a project from
the last year delivered projects. From there the team will have to refactor and
add a certain functionality so it meets the documentation of the project.

Detailed proposal

Here is the list of last year delivered projects and their specifications.

Project Meet Documentation Requirements Easy to understand Quality Coverage Build Documentation
participants-i1a Codacy Badge codecov Build Status
participants-i1b Codacy Badge codecov Build Status
participants-i2a Codacy Badge codecov Build Status
participants-i2b Codacy Badge codecov Build Status
participants-i3a Codacy Badge codecov Build Status
participants-i3b Codacy Badge codecov Build Status

Effect on long-term stability

This will be one of the most important parts of the project, it will define an
starting point for the whole project. From here will begin the refactor and the
new implementation.

Alternatives considered

Also participants-i3b was
considered and it is a good alternative. But due to its complication and the
resources used was dismissed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.