uws-eresearch / OR2014-chalege

Developer challenge entry for OR2014
0 stars 1 forks source link

New FML design to support any type of name authority #1

Open lloyd-h opened 9 years ago

lloyd-h commented 9 years ago

This is an idea to change current FML to be able to add any name authority in the future.

classdiagram

It works as below:

A request comes to the Index page. Request has entity_type and name_authority parameters with other keywords.

Inside Index page, based on the entity_type and the name_authority, it creates the matching SearchProvider and invoke getData(type) method.

$search_provider;

switch name_authority {

case "orcid" :

$search_provider = new Orcid(); $search_provider -> getData(entity_type); break;

case "mint" :

$search_provider = new Mint(); $search_provider -> getData(entity_type); break;

}

I came up with this design because I think current FML could've been designed better. It has separate PHP classes for each name_authority, for ex. Orcid for people and VIAF for something else and etc. same as the above design to some extent but not fully object oriented.

So what do you think? Your valuable thoughts of wisdom are most welcome :-)

alfski commented 9 years ago

if there will be more than a handful of name authorities, ServiceProvider() might want to pull the provider list from config rather than switching on 'special strings'.

but otherwise sounds fair.