ABAP-Games / Elifoot

Elifoot made in ABAP
MIT License
0 stars 0 forks source link

Team x Players relation #4

Closed fabiopagoti closed 9 years ago

fabiopagoti commented 9 years ago

A team might have several players.

However, a team can't have more than 27 players.

matheuscfontes commented 9 years ago

Question

A equipe só pode ter ate 27 Referencias a classe jogador?

fabiopagoti commented 9 years ago

Yes. But I would recommend creating an internal table of references instead of manually creating 27 references.

matheuscfontes commented 9 years ago

Question

Create an ZIT_EF_TEAM_PLAYER ? Table Type?

fabiopagoti commented 9 years ago

Give it a try.

Fábio Luiz Esperati Pagoti

On Fri, Jan 16, 2015 at 3:45 PM, matheuscfontes notifications@github.com wrote:

Question

Create an ZIT_EF_TEAM_PLAYER ? Table Type?

— Reply to this email directly or view it on GitHub https://github.com/ABAP-Games/Elifoot/issues/4#issuecomment-70291916.

matheuscfontes commented 9 years ago

Fabio , please review the team class.

The constructor method has been updated

fabiopagoti commented 9 years ago

[01/27/15, 16:51:19] Fabio Pagoti: 1) maintain a standard .. we will use 'soccer players' for players .. just rename the term 'athlete' [01/27/15, 16:51:44] Fabio Pagoti: 2) a type that is an internal table (like TY_PLAYER) I suggest switching to tt_player [01/27/15, 16:51:48] Fabio Pagoti: TT = Table type [01/27/15, 16:51:51] Fabio Pagoti: ty = Type [01/27/15, 16:52:20] Fabio Pagoti: 3) MAX_PLAYERS attribute would be better represented by a constant [01/27/15, 16:53:58] Fabio Pagoti: 4) has a bug in method insert Atlhete [01/27/15, 16:54:09] Fabio Pagoti: a comparison should be <and not <= [01/27/15, 16:54:21] Fabio Pagoti: if = the maximum the player should not be inserted [01/27/15, 16:54:31] Fabio Pagoti: 5) use the pretty printer

[01/27/15, 16:55:32] Fabio Pagoti: 6) when u try to create a team with more than the number of players allowed allowed, it would leave more interesting not create the team [01/27/15, 16:56:02] Fabio Pagoti: currently the team eh created qq way .. the only difference eh that u not copy players parameter if you many players [01/27/15, 16:56:20] Fabio Pagoti: create an exception class that represents an error of type 'Many players' [01/27/15, 16:56:33] Fabio Pagoti: if the parameter has many players shoot an exception in the constructor [01/27/15, 16:56:46] Fabio Pagoti: u will see that if an exception is triggered in the constructor the object ends up not being created [01/27/15, 16:57:03] Fabio Pagoti: these 6 items already dam good work

matheuscfontes commented 9 years ago

Question

Fabio, Is there need to be exceptions create a class?

This treatment can do within the own constructor in ZCL_EF_TEAM class.

fabiopagoti commented 9 years ago

The main idea of using exception classes inside a constructor is to avoid the creation of an object even using the CREATE OBJECT statement. How do you plan to do that without exception classes?

matheuscfontes commented 9 years ago

Question

The exception class is a class of messages?

fabiopagoti commented 9 years ago

I created an exception class called ZCX_EF_TOO_MANY_PLAYERS and changed the constructor of ZCL_EF_TEAM. Please take a look later and check what I meant.

After understanding what was done please close this issue.

matheuscfontes commented 9 years ago

It is used to ZCX_EF_TOO_MANY_PLAYER class to accuse a team when the number of players is maximum.