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

AndInThreadsTest.java:49-51: Remove the use of the static... #898

Open
0pdd opened this issue May 22, 2018 · 71 comments

Comments

@0pdd
Copy link
Collaborator

commented May 22, 2018

The puzzle 829-59f865f8 from #829 has to be resolved:

* @todo #829:30min Remove the use of the static method
* `Collections.synchronizedList`. Replace by an object-oriented approach.
* Create a class similar to `SyncCollection` but mutable.

The puzzle was created by Paulo Benety on 22-May-18.

Estimate: 30 minutes,

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.

@0pdd 0pdd added bug pdd labels May 22, 2018
0pdd referenced this issue May 22, 2018
@0crat

This comment has been minimized.

Copy link
Collaborator

commented May 22, 2018

@llorllale/z please, pay attention to this issue

@0crat 0crat added the scope label May 22, 2018
@0crat

This comment has been minimized.

Copy link
Collaborator

commented May 22, 2018

Job #898 is now in scope, role is DEV

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Jul 4, 2018

The job #898 assigned to @VsSekorin/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be a monetary reward for this job

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Jul 26, 2018

The user @VsSekorin/z resigned from #898, please stop working. Reason for job resignation: It is older than 10 days, see §8

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Jul 26, 2018

Job gh:yegor256/cactoos#898 is not assigned, can't get performer

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Jul 26, 2018

Resigned on delay, see §8: -30 point(s) just awarded to @VsSekorin/z

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Jan 15, 2019

The job #898 assigned to @Iprogrammerr/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be no monetary reward for this job

@Iprogrammerr

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2019

@0crat waiting on outcome of #1008

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Jan 15, 2019

@0crat waiting on outcome of #1008 (here)

@Iprogrammerr The impediment for #898 was registered successfully by @Iprogrammerr/z

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Feb 8, 2019

The job #898 assigned to @tomascury/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be no monetary reward for this job

@tomascury

This comment has been minimized.

Copy link

commented Feb 8, 2019

@0crat waiting on outcome of #947

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Feb 8, 2019

@0crat waiting on outcome of #947 (here)

@tomascury The impediment for #898 was registered successfully by @tomascury/z

@tomascury

This comment has been minimized.

Copy link

commented Feb 24, 2019

@0crat refuse

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Feb 24, 2019

@0crat refuse (here)

@tomascury The user @tomascury/z resigned from #898, please stop working. Reason for job resignation: Order was cancelled

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Feb 24, 2019

Tasks refusal is discouraged, see §6: -15 point(s) just awarded to @tomascury/z

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Feb 26, 2019

The job #898 assigned to @victornoel/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be no monetary reward for this job

@victornoel

This comment has been minimized.

Copy link
Contributor

commented Mar 2, 2019

@0crat refuse

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Mar 2, 2019

@0crat refuse (here)

@victornoel The user @victornoel/z resigned from #898, please stop working. Reason for job resignation: Order was cancelled

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Mar 2, 2019

Tasks refusal is discouraged, see §6: -15 point(s) just awarded to @victornoel/z

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Mar 7, 2019

The job #898 assigned to @longstone/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be no monetary reward for this job

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Mar 7, 2019

Job gh:yegor256/cactoos#898 already assigned to @longstone, can't assign to @longstone

@longstone

This comment has been minimized.

Copy link
Contributor

commented Mar 9, 2019

@0crat refuse

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Mar 9, 2019

@0crat refuse (here)

@longstone The user @longstone/z resigned from #898, please stop working. Reason for job resignation: Order was cancelled

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Mar 9, 2019

Tasks refusal is discouraged, see §6: -15 point(s) just awarded to @longstone/z

@0crat

This comment has been minimized.

Copy link
Collaborator

commented Sep 17, 2019

Are you speaking to me or about me here; you must always start your message with my name if you want to address it to me, see §1

@iakunin

This comment has been minimized.

Copy link
Contributor

commented Sep 17, 2019

@0crat waiting for @paulodamaso response

@0crat 0crat added the waiting label Sep 17, 2019
@0crat

This comment has been minimized.

Copy link
Collaborator

commented Sep 17, 2019

@0crat waiting for @paulodamaso response (here)

@iakunin The impediment for #898 was registered successfully by @iakunin/z

@fabriciofx

This comment has been minimized.

Copy link
Contributor

commented Sep 18, 2019

@paulodamaso @scristalli @victornoel @iakunin @llorllale @vzurauskas @skapral I don't like the idea of mutable collections or even mutable classes in Cactoos. To me, it's thw wrong approach to this problem. My suggestion is to implement a Persistent Data Structure (there's a nice discussion about it here) to make our collections trully immutable. WDYT?

@vzurauskas

This comment has been minimized.

Copy link
Contributor

commented Sep 19, 2019

@fabriciofx As far as I can tell, the latest decision was for envelopes to delegate everything to the enveloped collection. If the collection is mutable, then the envelope is mutable; if the collection is immutable, then the envelope is immutable. For situations when client explicitly needs immutable collections, immutable decorators were supposed to be introduced.

I think this is a good decision because copying the entire collection every time something needs to be added or removed might be unfeasible sometimes, and also there are situations where it's very difficult to fit PDS into given architecture, and it's not obvious it would be worth it. Furthermore, I think there should be no logic in envelopes other than delegating to the enveloped object for the reasons I outlined here.

@victornoel

This comment has been minimized.

Copy link
Contributor

commented Sep 19, 2019

@vzurauskas

…copying the entire collection every time something needs to be added or removed might be unfeasible sometimes.

This is not how persistent data structures work.

@fabriciofx That being said, maybe PDS is a good thing to implement, but it's another domain completely. Both needs exist (PDS or mutable collections) and they solve different problems. When doing OO, I personally see no problem with using mutable collections, except if it's used to implement DTO.

@paulodamaso Also another thing to take into account here is that it is great to want to reinvent the wheel, but we should be careful not to go too far where we are not able to succeed. Even implementing collections mutable or immutable is a big endeavour, and there exists already great OO libraries such as eclipse-collection (based on smalltalk collection design) and great PDS libraries in Java.

Personally I would continue the way it was planned, as @vzurauskas outlined.

@vzurauskas

This comment has been minimized.

Copy link
Contributor

commented Sep 19, 2019

@victornoel Oh, right, my mistake.

@paulodamaso

This comment has been minimized.

Copy link
Collaborator

commented Sep 19, 2019

@fabriciofx @vzurauskas @victornoel @iakunin Here are my considerations about this ticket:

  1. cactoos is, by definition, against the use of mutability (https://www.elegantobjects.org/#principles). So we shouldn't use mutable classes if we want to follow EO principles outlined in this link.
  2. Following the extensive discussion in #898, #947 and #1008, the idea of providing the immutability by the use of decorators looks like reasonable to me, even though it goes against the principle outlined in 1
  3. I like the idea of implementing PDS too, and I agree with @victornoel when he says that PDS is another problem domain; so, I think we should discuss it in another ticket.

So the real problem here is choosing between 1 and 2. I can't make this decision by myself since it changes the way cactoos follows EO principles. @yegor256 , what's your take on this? Which way should we follow, 1 (enforce immutability in all code blindly) or 2 (provide immutability by using decorators)?

@victornoel

This comment has been minimized.

Copy link
Contributor

commented Sep 19, 2019

@paulodamaso this is one thing to have mutability in a class and have the "real world" state that an object represent to be mutable.

So a decorator for collections does not have to enforce immutability on the decorated collection, it should only prevent mutability of the reference to the decorated collection.

IMHO:

  1. we shouldn't enforce immutability of decorated collection blindly: a decorator should do one and only one thing (so if it's job is mapping element of the decorated collection, it should only do that)
  2. if we want a decorator that enforces immutability on the collection (an ImmutableCollection decorator), then it's a good idea, it can be composed with other when needed.
@fabriciofx

This comment has been minimized.

Copy link
Contributor

commented Sep 19, 2019

@vzurauskas As @victornoel said, PDS are a completely different approach. It's made to perform immutable data sets properly.

@victornoel I see completly different. The immutable objects (mainly collections) is the heart of the problem because with mutable objects (or mutable collections) I can't share them properly. If I can shared, I've to copy them or I'll get problems with threads. I consider PDS into Cactoos a breakthrough in its development.

@paulodamaso I agree to discuss it in another ticket.

@skapral

This comment has been minimized.

Copy link

commented Sep 20, 2019

@paulodamaso @scristalli @victornoel @iakunin @llorllale @vzurauskas @skapral I don't like the idea of mutable collections or even mutable classes in Cactoos. To me, it's thw wrong approach to this problem. My suggestion is to implement a Persistent Data Structure (there's a nice discussion about it here) to make our collections trully immutable. WDYT?

@fabriciofx I'll just answer that I am neutral to this. Generally, I have no certain favourite between mutable or persistent collections, both have a right to live.

here

@iakunin

This comment has been minimized.

Copy link
Contributor

commented Sep 23, 2019

@paulodamaso so what’s your final decision? What should I do in this issue?

@paulodamaso

This comment has been minimized.

Copy link
Collaborator

commented Sep 23, 2019

@yegor256 Ping, I still want your opinion on #898 (comment) question, please

@iakunin

This comment has been minimized.

Copy link
Contributor

commented Sep 25, 2019

@yegor256 sorry for being so impatient, could you give your opinion about question mentioned above?

@yegor256

This comment has been minimized.

Copy link
Owner

commented Oct 10, 2019

@paulodamaso I vote for decorators. Keep in mind that 100% immutability is not only impossible, but is against the spirit of OOP. Please, read this: https://www.yegor256.com/2016/09/07/gradients-of-immutability.html

iakunin added a commit to iakunin/cactoos that referenced this issue Oct 17, 2019
iakunin added a commit to iakunin/cactoos that referenced this issue Oct 17, 2019
iakunin added a commit to iakunin/cactoos that referenced this issue Oct 17, 2019
iakunin added a commit to iakunin/cactoos that referenced this issue Oct 17, 2019
iakunin added a commit to iakunin/cactoos that referenced this issue Oct 18, 2019
iakunin added a commit to iakunin/cactoos that referenced this issue Oct 18, 2019
iakunin added a commit to iakunin/cactoos that referenced this issue Oct 18, 2019
iakunin added a commit to iakunin/cactoos that referenced this issue Oct 18, 2019
iakunin added a commit to iakunin/cactoos that referenced this issue Oct 18, 2019
iakunin added a commit to iakunin/cactoos that referenced this issue Oct 18, 2019
iakunin added a commit to iakunin/cactoos that referenced this issue Oct 20, 2019
iakunin added a commit to iakunin/cactoos that referenced this issue Oct 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.