Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor scalacheck instances #22

Open
wants to merge 1 commit into
base: v0.0.x
Choose a base branch
from

Conversation

etspaceman
Copy link

Hey There -

I saw this library and wanted to help you expand on the foundation here. I've always wanted a faker scala library that was built on top of scalacheck Arbitrary instances. 😄 I hope you'll accept some contributions here.

I noticed that it was a bit hard to understand how to use the domains in the scalacheck area, as they were based off of the underlying dataset rather than the data's domain. This refactor is intended to organize the existing instances by the data's domain.

In this case, 2 domains were created: name and company. I used package-objects to replicate your all instance setup. The end imports look like:

import ahlers.faker.scalacheck.company.implicits._

Or, for the kitchen-sink:

import ahlers.faker.scalacheck.implicits._

Once this is in, I'd like to expand on this and add more domains, like time, lorem, etc.

Let me know what you think.

@michaelahlers
Copy link
Owner

@etspaceman, thank you for the contribution! Sorry for the delay; just getting back from vacation and been itching to get back to work on this library. I'll take a close look at your suggestions and will follow up soon!

@michaelahlers
Copy link
Owner

@etspaceman, so! It's, uh, been a while… Life and work got busy and I had to shelve this project for a while. Revisiting this, I'm not sure about the future of this pull request. Of course, I appreciate your contribution, but It was too soon and I've given more thought to organizational principles.

In a nutshell, an aim of mine is to preserve as much from original sources as possible and present users a choice of how much or little detail they want. The width axis of package hierarchies represents sources (e.g., US Census, OpenData 500) and domains (e.g., persons, companies), and the depth axis represents the level of detail—greater specifics are available deeper in the hierarchy and commonality increases as it becomes more shallow. Soon I plan on introducing aggregations that'll synthesize domains from others but permit for a loss of information. For example, a "person profile" that'll aggregate companies and person names to form email addresses, phone numbers, full names, employers, and so on.

I'm close to merging #123, which should shed more light on how I envision this settling. Incidentally, I think it captures a few of your ideas and, soon after, I'll more generators that'll compose information as described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants