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

Consider library reorganization #410

Closed
DanSimon opened this issue Jun 20, 2016 · 2 comments
Closed

Consider library reorganization #410

DanSimon opened this issue Jun 20, 2016 · 2 comments

Comments

@DanSimon
Copy link
Contributor

DanSimon commented Jun 20, 2016

This would result in a significant project/package re-organization of the entire framework

What do we hope to achieve?

Goals:

  • Fewer wildcard imports needed for most tasks
  • Fewer unneeded things imported with wildcard imports
  • packages more closely match architecture
  • easier to split library into multiple artifacts

Non-goals:

  • ?

Caveats:

  • A lot of types could end up getting moved to a different package, making upgrading versions more difficult.

How to Categorize Types

Until Recently, many of the lower-level classes and traits were directly exposed to users. They used things like Protocol, Server, ServiceClient, and Codec directly. Now protocols have hidden nearly all those details, so the only people who deal with them are people writing protocols themselves.

The first major split (which sort of already exists) is a sharp divide between protocol-specific code and everything else. We already have protocols separated, but we could take this a step further by making protocols separate artifacts. Thus users would have to explicitly include colossus-http or colossus-redis as dependencies.

Second, we clearly have 2 different types of users.

  1. Application developers, people using colossus to build services
  2. Protocol/library developers, people using colossus to build libraries

So this means all types can be roughly split into 3 categories

  1. Application Types - used by app developers
  2. Library Types - used by protocol/library developers
  3. Internal Types - only used internally within Colossus

Lastly we could partition types into functional categories

  • Types used across the framework (like DataBuffer, Context)
  • Types related only to Servers
  • Types related only to Clients
  • Types only used inside protocols (like parsers, Encoding)
  • possibly others...

Package Structure

The way we can organize these could be:

  • Application types are all top-level in a package
  • Library Types are in a "core" sub-package
  • Internal types are also in the core sub-package, but potentially marked private

Now either we can do colossus.<functional_category>.core or `colossus.core.<functional_category>. So we need to decide whether function or user categorization should take precedence.

@DanSimon DanSimon added this to the 0.9.0 milestone Jun 20, 2016
@DanSimon DanSimon modified the milestones: 0.10.0, 0.9.0 Nov 22, 2016
@benblack86 benblack86 removed this from the 0.10.0 milestone Aug 14, 2017
@benblack86
Copy link
Contributor

An interesting article to provide motivation https://virtuslab.com/blog/zinc-sbt-friendly-code/

@benblack86
Copy link
Contributor

Closing for now as this should be recreated as an RFC.

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

No branches or pull requests

2 participants