-
Notifications
You must be signed in to change notification settings - Fork 165
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
Immutable.java:40-44: Original collection should be... #1236
Comments
@paulodamaso/z please, pay attention to this issue |
Job #1236 is now in scope, role is |
@paulodamaso @iakunin I'm a bit bothered by this job (which stems fro #1224 by @quantumlexa) because it highlights something contradictory in the objectives of the collection decorators in cactoos:
Both ways are correct, but we shouldn't mix them up. Currently, But collections, lists, sets, maps, etc, are not like that, they are meant to store data. Not to be "decorated". If you want to decorate a collection, you use the So back to
The example in the original issue (#1224) that brought us here is "stupid" when looked at through the lenses of real decorators that decorate existing proper objects: of course the wrapped collection is still mutable, and it's normal, it's a mutable collection! If I open a file in read-only from Java, it won't prevent someone from modifying the file on dik, it's the same situation. So: what should I do here? I don't agree with cloning the collection, I think I also think we should enforce the way the classes in the
I'm proposing not a full change of direction, but a clarification of the current design. @paulodamaso if we can first decide what to do with this issue, I will then create a new issue to discuss and if accepted, organise the work around my proposal. |
@0crat wait for ARC |
@victornoel The impediment for #1236 was registered successfully by @victornoel/z |
@victornoel @paulodamaso I think the main problem is to define what is immutability. To @yegor256 it's just to not change attributes values (they're attributed only in the constructor/construction phase, and to achieve it, we declare attributes using |
@fabriciofx I'm pretty sure we are safe to say we are not talking about functional immutability until now, hence my proposal to rename the class to |
@victornoel to me, no problem to rename it |
See @yegor256 opinion on that matter here: #898 (comment)
More generally, I think there is a confusion here between object mutability and mutability in the domain: when you look at Java's |
@paulodamaso ping? |
@victornoel I think that we shgould go this way:
I just have some concerns about renaming it because we already have a lot of reference around the term |
@paulodamaso ok, thank you, then I will remove the todo and tidy things up in terms of documentation. |
@victornoel Job #1236 is already on hold |
The puzzle |
@sereshqua/z please review this job completed by @victornoel/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed |
@0crat quality good |
Order was finished, quality is "good": +35 point(s) just awarded to @victornoel/z |
Quality review completed: +4 point(s) just awarded to @sereshqua/z |
The puzzle
1224-6c7b441d
from #1224 has to be resolved:cactoos/src/main/java/org/cactoos/collection/Immutable.java
Lines 40 to 44 in b9a9bee
The puzzle was created by iakunin on 10-Nov-19.
Estimate: 30 minutes, role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.
The text was updated successfully, but these errors were encountered: