יום ראשון, 11 במאי 2014

should-you-always-pass-the-bare-minimum-data-needed-into-a-function‏

I have found the following architecture dilemma in the following post In my opinion the method: void Authenticate (User pUser )  cause decoupling between the User class and the authenticator class.
In case we will want to authenticate a Roll the Roll should implement inherits from 
User. 
What about IAuthenticatee interface?
This raise the problem of authenticate not using name password group , so I change the name of the interface to INPGAuthenticatee  
Note : 
I think that creating an interface INPGAuthenticatee   that inherits from IAuthenticatee  make thinks too complicated at the first stages of the development and design process in order to KISS at the first stage we will use just the INPGAuthenticatee    interface and if there will be a need to authenticate using other information the authentication  in advanced stages  of the project the authentication mechanism will be refactor. 

I don’t like the option to give the User option to call authenticate directly because it will prevent the option to apply policy for example after 3 authentication failure to lock the account. 
(The policy component should be separate from the authenticate component)

Capture58

Resources:

http://programmers.stackexchange.com/questions/216371/should-you-always-pass-the-bare-minimum-data-needed-into-a-function‏


 

אין תגובות:

הוסף רשומת תגובה