Limit the public API of Querydsl #706

Closed
timowest opened this Issue Apr 9, 2014 · 7 comments

Projects

None yet

2 participants

@timowest
Member
timowest commented Apr 9, 2014

The public API of Querydsl should be more limited then it is currently and internal functionality should be better hidden.

The public runtime API could be something like

  • query classes: JPAQuery, SQLQuery etc
  • projections: Projections.*
  • dynamic expression creation: BooleanBuilder, PathBuilder, Expressions.*
  • query factory classes

The following classes should be better hidden

  • projection types: QBean, QTuple, ConstructorExpression
  • specialized operation types: SimpleOperation etc (at least construction)
  • specialized path types: SimplePath etc (at least construction)
@timowest timowest added the postponed label Apr 9, 2014
@timowest
Member
timowest commented Apr 9, 2014

Since these changes will not be backwards compatible they will be applied for the 4.0.0 release

@Shredder121
Member

Since I am also busy with ConstructorExpression (and out of curiosity), what were you thinking of hiding?

@timowest
Member
timowest commented Apr 9, 2014

Mostly the constructor and factory methods.

e.g.
Projections.tuple(...) vs new QTuple(...)
Expressions.path(...) vs new SimplePath(...)

The goal is to limit the amount of classes a user needs to remember to be able to get the full Querydsl experience.

@timowest timowest added this to the 4.0.0 milestone Apr 13, 2014
@timowest timowest modified the milestone: 4.0.0 Jul 14, 2014
@timowest timowest removed the postponed label Jan 15, 2015
@timowest timowest added the progress label Jan 28, 2015
@timowest
Member

Here is another change suggestion

  • Rename com.querydsl.core.types.expr to com.querydsl.core.types.dsl
  • Combine contents of com.querydsl.core.types.expr, path, query and template
  • Move com.querydsl.support.Expressions to com.querydsl.core.types.dsl
  • Make constructors of SimpleExpression subclasses in those packages protected
  • Remove static factory methods from the same classes

@Shredder121 What do you think?

@Shredder121
Member
  • Rename com.querydsl.core.types.expr to com.querydsl.core.types.dsl
  • Combine contents of com.querydsl.core.types.expr, path, query and template
  • Move com.querydsl.support.Expressions to com.querydsl.core.types.dsl

That sounds good.

  • Make constructors of SimpleExpression subclasses in those packages protected

Yes, that sounds good, as long as they are all still instantiable in some way.

  • Remove static factory methods from the same classes

What do you mean by this? Do you mean that all instantiation is done in Projections and Expressions?

@timowest
Member

What do you mean by this? Do you mean that all instantiation is done in Projections and Expressions?

Yes, that's the reason.

@Shredder121
Member

Then that sound good as well.

@timowest timowest referenced this issue Mar 14, 2015
Merged

Changes to Expression instance creation #1261

8 of 8 tasks complete
@timowest timowest closed this Apr 18, 2015
@timowest timowest removed the progress label Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment