[el-spec users] [jsr341-experts] Changing the collection method names
- From: Kin-man Chung <kinman.chung@...>
- To: jsr341-experts@...
- Subject: [el-spec users] [jsr341-experts] Changing the collection method names
- Date: Mon, 13 Aug 2012 11:22:22 -0700
- List-id: <jsr341-experts.el-spec.java.net>
Another feedback for the public review raised the issue of how EL 3.0
will work with Java SE 8.
SE 8 is not out yet, but will be next year. It also contains Lambda and
some collection operators, so it become important that EL 3.0 and SE 8
works together well. The syntax for Lambda is the same in EL and SE8,
so we are OK there. The area of collection operation support is more
problematic, because there is only a smaller set of operations in SE8
and their names and behaviors are not the same as those in EL.
What is important is the new methods added in SE 8 will be invoked
through reflections in EL (we'll need to get this to work in
BeanELResolver). To avoid invoking the unintended methods in EL, we'll
need a way to name our methods differently from Java names. Suggestions
1. Begins with a capitol, e.g.
products.Where(p->price > 10).Select(p->p.name)
2. Prepend with an el$, e.g.
products.el$where(p->price > 10).el$select(p->p.name)
3. Prepend with a $, e.g.
products.$where(p->price > 10).$select(p->p.name)
Personally, I think 1. is too easily confused with ones in lower case,
and 2. is too ugly, 3. is a good compromise.