-
Notifications
You must be signed in to change notification settings - Fork 2
Master.java:33: Master is set of states inside XML document. #36
Comments
@0pdd thank you for reporting this. I'll assign someone to take care of it soon. |
I see you're talking to me, but I can't reply since I'm not a chat bot. |
@l3r8yJ this is your task now, please go ahead. Deadline (when this ticket should be closed) is Estimation here is Remember, you don't have to solve everything in this ticket - you can solve it partially and leave If you have any questions don't ask me, I'm not a technical person. Open new tickets instead. If you don't have time or simply don't want to work on this, you can always resign. |
@l3r8yJ Don't forget to close this ticket before the deadline (2023-08-21T10:29:18). You are past the first half of the allowed period. |
@zoeself deregister |
@h1alexbel ok, I've removed this task from scope. I'm not managing it anymore. |
@l3r8yJ WDYT? new Master(
new ListOf<>(
new XmlState(
new XMLDocument(
new ResourceOf("cmig/master.xml").stream()
),
"1",
"cmig"
)
),
cassandra
); |
@h1alexbel what is |
@l3r8yJ State ID |
@h1alexbel Why do we need a state id at a time when we have an entire xml file? Or am I not understanding what it's for? |
@l3r8yJ Master is a set of States, while state is denoted by ID |
@h1alexbel I think passing id as a parameter is not the best idea, it would make this design not flexible enough, wdyt? |
@l3r8yJ what you are suggesting then? |
@h1alexbel smth like new Master(
new State(
cmig,
master
),
cassandra
).migrate() where
wdyt? |
@l3r8yJ looks interesting, but in this example, master consists of only one state, I suggest the following design: new Master(new States(xml).value()), cassandra).migrate(); WDYT? |
@h1alexbel master encapsulates a state that contains state changes - so it's not just one state. I don't think we need to bind us to ctor parameters with lists of states and such Also id as a parameter looks bad to me - since we are not telling the object what xml we want to get the state for the database from, we are saying here's an id, here's something else, do the data conversion for me and give back the data Also if you pass wdyt? |
@l3r8yJ agree with you, let's try to design Master.java in the following way: @Override
public String value() {
final List<String> shas = new ListOf<>();
new Ids(this.self)
.value()
.forEach(id -> {
final String author = new Author(this.self, id)
.asString();
// persist author, id, and sha of change state to the cassandra table
final String sha = new Sha(
id, this.self.toString(), this.cmig
).asString();
shas.add(sha);
new Names(this.self, id)
.value()
.forEach(
name -> new InFile(
this.cassandra, name
).apply()
);
});
return shas.get(shas.size() - 1);
} Master encapsulates only: XML named self, CMIG dir and Cassandra connection WDYT? |
@h1alexbel why we're passing |
@l3r8yJ to get last sha |
@h1alexbel can we wait couple of week for this? |
@l3r8yJ we can refactor this later, but now Its OK to use |
@h1alexbel Also I think |
@l3r8yJ maybe just remove this variable? and it will be |
@h1alexbel yeah, I was thinking the same thing |
The puzzle
32-ae85e224
from #32 has to be resolved:cmig/src/main/java/io/github/eocqrs/cmig/Master.java
Line 33 in 8d1946d
The puzzle was created by @rultor on 11-Aug-23.
Estimate: 45 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: