Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Alex Shykhman

Greenhorn
+ Follow
since Feb 29, 2016
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alex Shykhman

Thank you for the wide answer!
I'm glad it is pretty close to my own opinion.

I've had heard several times an opinion that Spring is good for making simpler things, when the main goal is to run the product and show it to customer. Especially when it doesn't requires "Rocket Science" solutions. On the other hand, JavaEE allows a lot of fine-tuning, when you need efficient persistence, transactions, fault-tolerance, horizontal scalability etc, so for complex development requests it may be better. Does this make sense?
Hi!
Recently a lot of debates and discussions occur regarding what is better: using native Java EE stack or use one of the countless Pivotal solutions along with Spring Boot.
How do you think, what are pros and cons of using each of these variants? What is the perfect project to build it on Java EE stack and where usage of JEE is less efficient?

Thanks

Giovanni Montano wrote:
Well I know them at a superficial level.


Generics are intended to restrict and set rules for possible arguments and return types. It looks like a contract. If method accepts something like T extends Something, that means you can't pass as an argument anything but Something or its child classes. If you have parameterised collection, for example ArrayList<String>, that means you can add only strings to such collection. Etc.
All generics in Java are being checked and erased at compile time. In runtime they are replaced with class casts and checks, so generics are rather useful for developers than users.
3 years ago
Welcome! Always nice to see book authors on CodeRanch
3 years ago

Mohamed Sanaulla wrote:
No, reflection is still supported. You have to check the new command line options which have been introduced to support deep reflection which libraries like hibernate do. This support introduced is a temporary one to provide time for all the libraries to fix themselves.

And I find nothing complicated in the maven instructions, I guess a few new tags to add which modules it depends and that's it. So you can use non-modular jars as automatic modules in your modular application and they work just fine!!!


I don't say any of this idoesn't work. I just say, that new Java is significantly different. For instance, if you have old massive legacy project and your customer wants everything up to date, including Java version, migration may be very painful.
3 years ago

Jesper de Jong wrote:
In what way do you think it was unfortunate?


I mean Jigsaw in the first place. Reflection usage was cut, Maven builds now require additional instructions which sometimes weren't clear, many 3-party libs stopped working. If they are no longer supported, then they should be replaced with something. Java 9 introduces completely new, different approach. Sometimes it causes troubles.
3 years ago
Hi all!

For the last 2 years I worked on different Java projects in three different companies. Java is one of the most popular language today and yet I increasingly wonder about expanding my area of competence. In my opinion latest Java release was unfortunate. On Ukrainian forums (I'm living in Ukraine) people talk about migrating their projects from Java to Kotlin. They say Java lacks many useful features and we can't hope it will support these features in the foreseeable future.

Ok, I don't mind. Especially since Google claimed its support. The question is: where Kotlin is the best? I suppose, I can write almost any application with it. But what are its exact benefits? Where it fits better than any other language? What area of development is preferable?
3 years ago
I finally did it! Now, after many hours of debugging and trying to find out what all these X-Y-ended variables mean. I could not bind anything to my anchor and I didn't understand why. Later I just understood I used TranslateX to change Anchor's position. And all LabelLine children I've bound to LayoutX. Now I've changed it and it seems the model is working. I'll try to put out a link on Github soon.
4 years ago
Ok, let's put out idea about making a node from LabeledLine. So, what we have?
Do you mean that in this code:

we can bind the ends of BoundLine to the Anchors' central coordinates from here:


If I got you right, I can just define Coordinate variables in the anchor (what if circles with their coordinates are just a view of the bigger AnchorNode? Is it acceptable?) and later just add lines... Let us assume we have a lot of Anchors. We can get their DoubleProperty coordinates. We choose two nodes and we want to create a connection. So we should pass to Connection's constructor these properties. And then what? How should we display this new connection properly?
4 years ago

John Damien Smith wrote:No worries Alex, I had the time. Some problems are more interesting than others and this was one of the more interesting ones to solve. Hopefully it is worthwhile for you.


I have some questions about your solution. I couldn't understand how a LabeledLine is bound to Anchor? Both of them use something like independent coordinates.
I tried to implement it but didn't manage to do it completely. I have a graph that contains all of nodes and edges. Like this:




So I have to bind LabeledLine (as a Group) to coordinates of two AnchorNodes. And somehow draw its BoundLine and Label respectively. I managed to bind only BoundLine by adding it directly to mainPane's children.

But it didn't work with label. It seems I need your advice again if you have a time.
4 years ago
Thank you, John! I'll try to completely understand how does your code work and to use it in my application. You really did a big work for me, it's a little awkward...
4 years ago
Thank you for reply, John!
Well, I've already created the whole system. It already has all the backend.
It has a GUI. GUI allows to create Nodes and Connections between them. Nodes are draggable, connections move after them.

My real problem includes next questions:
1. I don't know how to create a separate line with a text above it (or two lines with a white fill where text could be placed). It is a separate task. What I have now you can see in the code below.

2. I don't know how to provide ability for text to roll if the line after node dragging ended upside down. Let's imagine the code:


3. Connections overlap nodes. It's said that on the pane children overlap each other as they are rendered. And there are toBack() and toFront() methods that didn't work in my case.
Node creation:

Connection creation:
4 years ago
Hi, all! I'm new on this forum and I'm glad to join you.

And here is my question. For now I'm making a pet-project on JavaFX. Its' main purpose - find the shortest way between all nodes considering edge weights. Algorithm is quite simple, but I got a problem with GUI.

I have a pane. It has kids: nodes and edges in the form of separate panes. Each node can be connected to any other node. A connection(graph's edge) should be like a line and a distance written above it. All connections should hide behind nodes* . All nodes should be draggable. That mean all connections should dynamically move after dragged node and the distance sign should also move toward the center of connection**. So here are my current tasks I need your help with. Thank you in advance.


* - since all nodes are rendered before we created any connections, latter overlap former. toFront() and toBack() methods didn't help for some reason.
** - of course if we moved left node and right node and then swapped them, we may end up in situations when the text is upside down. So I should just... turn it somehow?
4 years ago