elixirs / faker

Faker is a pure Elixir library for generating fake data.
MIT License
1.08k stars 218 forks source link

Introducing namespaces #208

Open vbrazo opened 6 years ago

vbrazo commented 6 years ago

We want to create namespaces because you and I like Faker and want to keep the library organized and easy to use. Besides that, we need to determine great taxonomy to maintain and scale our modules.

I'm going to start suggesting a few namespaces for the current modules.

Faker.Bitcoin => Faker.Blockchain.Bitcoin

Faker.Cat => Faker.Creature.Cat
Faker.Team => Faker.Creature.Team
Faker.Team.En => Faker.Creature.Team.En

Faker.Pokemon => Faker.Fiction.Pokemon
Faker.Pokemon.En => Faker.Fiction.Pokemon.En
Faker.StarWars => Faker.Fiction.StarWars
Faker.StarWars.En => Faker.Fiction.StarWars.En
Faker.Superhero => Faker.Fiction.Superhero
Faker.Superhero.En => Faker.Fiction.Superhero.En

Faker.Beer => Faker.Objects.Beer
Faker.Beer.En => Faker.Objects.Beer.En

I'll try to come with taxonomy for the other modules soon. Feel free to suggest a few good namespaces. Your ideas are always welcome.

Faker.Address
Faker.Address.En
Faker.Address.Es
Faker.App
Faker.Avatar
Faker.Cat.En
Faker.Code
Faker.Code.En
Faker.Color
Faker.Color.En
Faker.Color.Es
Faker.Color.PtBr
Faker.Commerce
Faker.Commerce.En
Faker.Company
Faker.Company.En
Faker.Date
Faker.DateTime
Faker.File
Faker.Food
Faker.Food.En
Faker.Gov.Us
Faker.Industry
Faker.Industry.En
Faker.Internet
Faker.Internet.En
Faker.Internet.Es
Faker.Internet.PtBr
Faker.Internet.UserAgent
Faker.NaiveDateTime
Faker.Name
Faker.Name.En
Faker.Name.Es
Faker.Name.PtBr
Faker.Nato
Faker.Phone.EnUs
Faker.Phone.EnGb
Faker.Pizza
Faker.Random
Faker.Random.Elixir
Faker.Random.Test
Faker.String
Faker.Util
Faker.UUID

Lorem already looks ok, doesn't it?

Faker.Lorem
Faker.Lorem.Shakespeare
Faker.Lorem.Shakespeare.En
Faker.Lorem.Shakespeare.Ru
anthonator commented 5 years ago

I'm not sure how I feel about additional namespacing. It doesn't seem incredibly intuitive to me. I'd never think to look for StarWars under Fiction. It's also adding additional vertical space that I think is unnecessary.

Just my $0.02. 😄

altyaper commented 5 years ago

I think it's quite good idea to extend a little bit the namespaces as you suggest @vbrazo, We could prevent to have overwritten modules. I can take this task of the suggested namespaces you provided if you want.