Problema aplicação cliente-servidor e cast de classes Java

boa tarde!

Tenho uma aplicação em Java dividido da seguinte forma: -Cliente: é baixado pelo usuário. Basicamente, interface gráfica. -Modelo: também é baixado pelo cliente. Possui as classes comuns ao Cliente e ao Servidor. Entre outras, as classes Barra e Estrutura com um monte de gets e sets. -Servidor: onde é realizado os cálculos/lógica do negócio. É executado remotamente em um servidor (via SOAP) e, portanto, não é baixado. Para processamento, as classes ModeloBarra e ModeloEstrutura estendem as classes Barra e Estrutura.

Durante a utilização, no cliente, a classe Estrutura é serializada com o XStream (para xml) e enviado ao servidor para processamento e posterior retorno. No servidor, deveria ser realizado um cast de Barra (enviado pelo cliente) para ModeloBarra (que possui a lógica do negócio), mas esse cast não é possível:

java.lang.ClassCastException: xyz.porticum.modelo.Barra cannot be cast to

Até então, tenho utilizado a desserealização de Barra para ModeloBarra, via XStream. Tem funcionado, porém, é uma grande gambiarra. Estou implementando novas funcionalidades e estou tendo dificuldades com essa solução.

De que outra forma poderia realizar esse “cast”? Há algum Design Pattern para problemas desse tipo? Cliente e servidor em que as classes do servidor estendem das classes do cliente.

Desde já, muito obrigado!

If you cast Darkness using sorcery points (Shadow Sorcerer) do you need material components?

Shadow Sorcerers at 3rd level gain the spell Darkness which doesn’t count against spells known. In addition, you can cast this spell by expending 2 sorcery points. I wanted to know if you could circumvent the material cost by using sorcery points. I’m assuming you do need the components as sorcery points seem to function like auxiliary spell slots.

Is it possible to cast two 9th level spells without taking a long rest in 5e?

The 9th level spell “foresight” says that the spell immediately ends if you cast it on another target before the duration is up. However, the duration is 8 hours, and while I get that you could cast it before the duration was up using the elven 4 hour rest or something like that, is there any way to cast any official 9th level spell without taking a long rest?

How do Arcanists prepare and cast spells?

I tend to main spontaneous casters like Sorcerers and Oracles, occasionally dabbling in prepared casters with Magus or spontanous martials like Eldritch Scion Magus and Bloodrager. So, I like to think that I’m fairly well-versed in how casting spells works. Generally, for spontaneous casters, it works like this:

  1. Select the spell from the list of spells you know.
  2. Cross out one of your spell slots until you regain your spells.
  3. Cast the spell, using spell components and foci as necessary.

For prepared casters, it generally works like this:

  1. Fill your spell slots with spells from the list of spells you know.
  2. Select the spell from your slots that you wish to cast.
  3. Cross out the spell slot until you regain your spell slots for memorization.
  4. Cast the spell, using spell components and foci as necessary.

However, looking over Arcanist, I am having a hard time comprehending the process by which they cast their spells. Are they spontanous casters or prepared casters, or are they something else entirely?

Can you ritual cast multiple Phantom Steeds and continue re-summoning them while traveling?

Can you ritual cast the Phantom Steed spell multiple times and in practice just re-summon them while you are traveling? So for example, could a Wizard ritual summon a horse, three times in a row. And then just focus on re-summoning them while he’s riding one of them. The spell lasts 1 hour, ritual casting it 3 times would take 33 minutes. So he should have more than enough time to summon new horses for himself and his party before any of the individual horses disappear. Is this correct?

Does the effect of the Command spell take place immediately if cast on the target’s turn?

The target must succeed on a Wisdom saving throw or follow the command on its next turn.

If you were to cast Command as a reaction (e.g. readied action or war caster opportunity) on the turn of the spell’s target, does the effect of the spell take place immediately or on the next round?

e.g. If I held the command spell and triggered it once an orc ran around the corner into view and told it to “grovel”, would that end the orc’s turn there, or would the orc complete it’s turn unaffected, only being forced to grovel next round?

Grovel: The target falls prone and then ends its turn.

What are the balance implications of allowing only one non-reaction, non-cantrip spell to be cast per turn?

There have been several questions on the bonus action spell casting restriction which states (PHB, page 202):

[If you cast a bonus action spell] you can’t cast another spell during the same turn, except for a cantrip with a casting time of 1 action.

The number of questions on this make me feel it is not exactly an intuitive, or easily understood rule. In This Q/A David Coffron states the effects of this rule as follow:

“If you cast (or will cast) a bonus action spell (cantrip or non-cantrip) in a turn, no other non-cantrip spells (even ones using the action from action surge) can be cast.”

While this is certainly simpler there are multiple parentheticals and in particular the “or will cast” bit is, at least to me, an especially unusual way to write a rule.

So I changed the rule and am wondering if using the following instead of the bonus action casting restriction is imbalancing:

You cannot cast more than one non-reaction spell of first level or higher on a turn.

Normally, as shown in this Q/A if you cast a bonus action spell you are now unable to cast a reaction spell on your turn such as shield; this would no longer be a rule.
Without the “non-reaction” bit, you would be unable to cast a reaction spell on the same turn you cast an action spell. A common way for this to happen is if you cast, say, fireball and somebody cast counterspell on you, and you wanted to counterspell their counterspell. The “non-reaction” bit allows you to still do this, and the general change now allows you to do this even if you cast fireball as a bonus action, which previously was not possible.

Borrowing the table of all legal spell casting combinations from this Q/A this rule would change the table to the following (Ones that have changed from how they would work under the usual rules are marked with an asterisk): \begin{array}{|l|l|l|lr|} \hline \textbf{Action } & \textbf{ Bonus Action } & \textbf{ Action Surge } & \textbf{ LEGAL } & \kern 7em \ \hline \text{Non-Cantrip } & & & \text{ Yes } \ \hline \text{Cantrip } & & & \text{ Yes } \ \hline & \text{ Non-Cantrip } & & \text{ Yes } \ \hline & \text{ Cantrip } & & \text{ Yes } \ \hline \text{Non-Cantrip } & \text{ Cantrip } & & \text{ Yes* } \ \hline \text{Cantrip } & \text{ Non-Cantrip } & & \text{ Yes } \ \hline \text{Non-Cantrip } & \text{ Non-Cantrip } & & \text{ No } \ \hline \text{Cantrip } & \text{ Cantrip } & & \text{ Yes } \ \hline \text{Non-Cantrip } & & \text{ Cantrip } & \text{ Yes } \ \hline \text{Non-Cantrip } & & \text{ Non-Cantrip } & \text{ No* } \ \hline \text{Cantrip } & & \text{ Non-Cantrip } & \text{ Yes } \ \hline \text{Cantrip } & & \text{ Cantrip } & \text{ Yes } \ \hline \text{Cantrip } & \text{ Non-Cantrip } & \text{ Non-Cantrip } & \text{ No } \ \hline \text{Non-Cantrip } & \text{ Cantrip } & \text{ Non-Cantrip } & \text{ No } \ \hline \text{Non-Cantrip } & \text{ Non-Cantrip } & \text{ Non-Cantrip } & \text{ No } \ \hline \text{Non-Cantrip } & \text{ Non-Cantrip } & \text{ Cantrip } & \text{ No } \ \hline \text{Cantrip } & \text{ Non-Cantrip } & \text{ Cantrip } & \text{ Yes } \ \hline \text{Non-Cantrip } & \text{ Cantrip } & \text{ Cantrip } & \text{ Yes* } \ \hline \text{Cantrip } & \text{ Cantrip } & \text{ Non-Cantrip } & \text{ Yes* } \ \hline \text{Cantrip } & \text{ Cantrip } & \text{ Cantrip } & \text{ Yes } \ \hline \end{array}

The first change is not imbalancing as shown in this Q/A; however, Action Surge (the last two changes) is not mentioned, though I doubt it would have significant effects on balance.

I am wondering if the other change, Action Surge no longer allowing one to cast two non-cantrip spells, makes the Fighter class (Eldritch Knight, and also multi-classing) significantly worse off than before.

Can you cast a blanket Invisibility and let the targets see each other?

Can you use the 3rd level or higher part of Invisibility to make a small group invisible but still able to see each other, like Cloak the Gathering can?

Invisibility states:

A creature you touch becomes invisible until the spell ends. Anything the target is wearing or carrying is invisible as long as it is on the target’s person. The spell ends for a target that attacks or casts a spell.

When you cast this spell using a spell slot of 3rd level or higher, you can target one additional creature for each slot level above 2nd.