Sunday, January 26, 2020

Netbeans platform. Step 1.

In the modern world, the majority do not believe in desktop applications. They think that everything should be on the web or mobile. But there are cases when you need a software just for personal needs. For example hex editor, file manager, image editor, database clients. For such cases, desktop applications simply look better.

After some investigation, I've stopped on Netbeans' platform.

Main reasons why are:
  • Cross-platform.
  • Uses java.
  • Simpler than Eclipse.
Let's begin. Everything that is required is maven. There is an archetype to generate Netbeans Platform application. So, just execute in the terminal next command:

mvn archetype:generate 
    -DarchetypeGroupId=org.apache.netbeans.archetypes 
    -DarchetypeArtifactId=netbeans-platform-app-archetype 
    -DarchetypeVersion=1.22 
    -DgroupId=com.mycompany.project 
    -DartifactId=Demo

The next step is to build the project. Go to the directory Demo and execute
mvn install

That is all. In the directory Demo/application/target/demo/ you will find execution files. Just execute it to see your first window.


Saturday, January 25, 2020

VueJS? I guess no.

Two years ago I started VueJS + Vuetify project. At that moment it looked a good solution - a popular framework and rich library of components.

For today I can say that VueJS has few "features" that I really do not like and for the next project probably will take something else.

 Here is my list:
  • JS is pretty terrible. When you write a code it looks more or less acceptable. But when you need to support it, refactor, etc it became a nightmare. Typescript helps a lot but still, there is a big feeling that behind is JS. VueJS tries to swallow types on every step - when you access vuex store to get some values or to dispatch actions. Everything that's going on in the template is not type-safe. 
  • VueJS does not allow to declare events for components. There are two types of communication between components. From parents to children using properties. Children should declare own properties and then parents can use them to send information. The second type of communication is from children to parents using events. But in this case, there is no possibility to declare what events can be emitted from children to parents. So, you have to trust for documentation or to read the source code of the component.
  • There is not a proper inheritance. It is possible to extend the Html template using slots. Or to attach some common logic using mixins. But, for example, to extend form component to add additional text fields and some validation logic it is not possible.
So, these few features do not allow for me to reuse and combine my code as I want. At every moment I need to keep in the mind what types and where I use. Refactoring tools - I forgot what is that. All of that makes me slower and less productive. That's why next time I will try something else.