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

Discussion, requirements about NetBeansIDE-mvvmFX-Plugin #342

Closed
Naoghuman opened this issue Dec 19, 2015 · 18 comments
Closed

Discussion, requirements about NetBeansIDE-mvvmFX-Plugin #342

Naoghuman opened this issue Dec 19, 2015 · 18 comments
Labels

Comments

@Naoghuman
Copy link
Contributor

Like suggest from Alexander here a ticket for a planed NetBeans plugin.
https://github.com/Naoghuman/NetBeansIDE-mvvmFX-Plugin

First steps I planed was:

  • Implement the 3 example projects from you (hello world, guice, cdi-weld) in the new Project wizard
  • Implement file generation for mvvmFX (ViewModel, View, fxml) in the right packages.

I thing for the first version is that okay.

  • Then publish it to NetBeansPortal and UC.
@Naoghuman Naoghuman changed the title NetBeansIDE-mvvmFX-Plugin Discussion, requirements about NetBeansIDE-mvvmFX-Plugin Dec 19, 2015
@manuel-mauky
Copy link
Collaborator

Hi Peter,
many thanks for your project idea. Your planned features for the first release sounds good for me.

here some other ideas for future versions:

  • refactoring support: If a view class is renamed/moved around the fxml file should be renamed/moved too. Same in the other direction, when fxml file is renamed the view class should be renamed too.
  • If the fxml file doesn't match the name/location of the view class a warning should be shown
  • Warnings when UI controls are imported and/or used in the ViewModel
  • Warnings when a View class is imported and/or used in a ViewModel

@manuel-mauky
Copy link
Collaborator

Related issues: #339, #175

@Naoghuman
Copy link
Contributor Author

I see in mini-examples there are different easy example projects. I think there are a good choice for the example projects. I have 2 possiblilities for the structure in the New Project wizard:

  1. Directly under Samples/Maven and every project have the prefix mvvmFX.
    mvvmfx-newproject-example1

  2. With a new folder under Samples/Maven/mvvmFX and the project have then no prefix.
    mvvmfx-newproject-example2

Which one would you favor?

@manuel-mauky
Copy link
Collaborator

I don't know what typical netbeans users would expect. I think a sub folder is good idea but I would expect it to be a top level folder ("Samples/mvvmFX") or a sub folder of JavaFX. In my opinion Maven is only a technical aspect so I wouldn't search there for samples. On the other hand in your screenshot there is a JSF and a REST application in the maven sub folder too so it's probably ok to add mvvmFX there too. But as I said I'm not a netbeans user so I have no strong opinion in this case ;-)

@Naoghuman
Copy link
Contributor Author

Hm yes :) the examples are hybrid projects (Maven and JavaFX and more). So I thinks its okay when we make a new folder directly under "Samples" like you suggested -> "Samples/mvvmFX" directly under the "Maven" folder. Its also easier for the user to find :) .

@Naoghuman
Copy link
Contributor Author

Hi,
I think integrating the 5 mini examples into the plugin is also a great opportunity for refactoring them. Also I have some questions to the examples.

a) Name from the mini examples

Intention is here when the user create more then one (we will hope that he create all :) ) that all projects are ordered together in the project overview through their naming.

Current:

  • Example with fx:root
  • HelloWorld Example
  • HelloWorld Example without FXML
  • mvvmfx - synchronizeFX example
  • mvvmfx - welcome screen example

Suggestion:

  • mvvmFX - LabeledText Example with fx:root
  • mvvmFX - HelloWorld Example
  • mvvmFX - HelloWorld Example without FXML
  • mvvmFX - synchronizeFX Example
  • mvvmFX - WelcomeScreen Example

b) Naming convention package, View, ViewModel

I thought that the packagename, PrefixView, PrefixViewModel names are per convention are must equals like in afterburner.fx. For example:

  • de.saxsys.mvvmfx.test.TestView, ...TestViewModel (thought that must be)
  • a.b.c.AView, ...DViewModel (works also)

When mvvmFX have the naming convention that the packagename and Prefix from View and ViewModels must equals then it should checked from the library. When not its a little more effort to implement the functionality in the plugin that the user can type what he want.

I see in 3 examples package, prefix from View, ViewModel are equals, in other not. Normaly I would do here a refactoring for all 5 projects, that the package and prefix from View and ViewModel are equals.

c) Tutorials and JavaDoc in examples

I see that in wiki from mvvmFX are many tutorials about the examples. What do you think about the idea to extend the JavaDoc (and commentary) from the projects. So the user have the opportunity when he have created an example via the plugin that he can read in the JavaDoc and commentary in the project whats going on.

Questions

For the possibility that I do a request in the future :) . I see that the indentation in the sourcecode is 2 tabs and between every line is an empty line. Is that a project convention? Normally I make 1 tab indentation and structure the lines individual.

@manuel-mauky
Copy link
Collaborator

Hi,
a) you are right. A common naming scheme would be a good idea. And I like the names you have suggested, with one exception: The "welcome-example" had a bad name in the first place. The purpose of this example is to show the integration of the dependency injection libraries CDI and guice. We should use the opportunity to find a better name. Maybe "mvvmFX - dependency-injection example"?

What I'm asking myself is whether we need all these examples in the IDE plugin. Some of them may not be really interesting for a developer who simply want's to try out the framework. For example the synchronizeFX example is more a prove of concept that the integration with the synchronizeFX lib is working. I think we should have:

  • helloworld
  • helloworld without fxml
  • todomvc
  • dependency injection example
  • contacts example for a more complex application

All others are optional in my opinion. But as always: It's only a suggestion, the decision is yours ;-)

b) We recommend a naming convention of "View" and "ViewModel". If there are places in the examples where this convention isn't used yet we should rename them.
However there are reasons why we shouldn't force these conventions from the framework:

  • It's unusual but possible to use a single ViewModel for multiple Views. In this case you have to name them differently.
  • We don't want a dependency from the ViewModel to the View. If you rename the View (for whatever reasons) you shouldn't be forced to rename the ViewModel too. Otherwise this would mean an implicit dependency. Of course in practice, most of the time you will rename both at the same time but we shouldn't force the developer to do so.
  • It would mean a API breaking change which we try to avoid as much as possible.

For the package naming: In my opinion the naming of packages is a responsibility of the developer. There may be good reasons to put multiple views and viewmodels into the same package. I'm doing this sometimes when two views are tightly related to each other and I don't want to split them.
Some developers might want to have a package for all viewModels and another package for all the views. Personally, I absolutely don't like this approach but a developer may have his/her reasons for this.

c) I totally agree with you. We should have extended the javadoc in the first place but, as you might know from your own projects, creating good documentation is hard and time consuming. It's a lame excuse of course so shame on me.

indentation) we have an eclipse formatter that has settings for indentation and other style guides. The problem is: I don't use eclipse (anymore) and maybe wasn't careful enough in the past so maybe there are different styles in the code. Would be a good opportunity to introduce a common style guide. How do you configure style settings in netbeans? Is there a way to share such settings between IDEs?

I have a question too: How do we update examples in the future? From time to time I'm refactoring the examples when a new feature is introduced to the framework. Maybe I should file an issue in your github project to update the examples from time to time?

Thanks for your questions and your work :-)

@Naoghuman
Copy link
Contributor Author

Hi,

a) Examples
First some background information :) . I have two possiblilities to create the examples:

  • Fork your project and use the example-projects via import into the NetBeans plugin
    which create then a zip file (which will then unpacked if the user create the example).
  • I see that its also possible to create the example projects via maven archetype.

In both cases I used the projects as they are in your GitHub repository or in maven central.
That would be make it also easier for the future updates (new, updated examples) into the
plugins.

At first I will choose the first possiblity so I can also contribute to the examples.

So as a summary:
Mini examples

  • helloworld
  • helloworld without fxml
  • dependency injection example (old welcome example)

Extended Examples

  • contacts-example
  • todomvc-example

b) Naming convention (View, ViewModel)
dependency injection example (old welcome example)

  • In the welcome-example is a class with the name PersonLoginViewModelNotifications.
    Perhaps here should be done a little refactoring to PersonLoginNotificationsViewModel.

contacts-example

  • In the resources packages are many fxml files where the suffix 'View' is missing.
  • The depending classes in the java packages are also missing the suffix 'View'.

c) JavaDoc and commentary
Yep, needs a good time to do :). But what I learned on the hard way that its need more
and more time how longer you will wait. I see in the main projects are JavaDoc included.

So I think its okay when we first let this step out :).

d) Codestyle
What I found is the Google CodeStyle guide:

They have two styles for Idea and Eclipse which can import into the IDE:

  • eclipse-java-google-style.xml
  • intellij-java-google-style.xml

There is a bug #56 'Add Java style for Netbeans' where the users want also a style xml
file for NetBeans.

I think the files can modified for the projects needs and then shared over the repository (when you decide to use them).

e) Update examples in plugin
I think that its a good idea to file a issue (which are new or updated) in the plugin project.
Its easier for me to see then that something have changed :) .

Summary
So when its okay for you I would like do in the next days:

  • Refactore the welcome-example to dependency injection example (also welcome package to dependency.injection)
  • Add the missing suffix (see b)
  • JavaDoc and commentary will be stepped first
  • First I do a little cleanup in the formatting (remove empty lines and double tab intention).
    Later when you have decided to used a specific code style (or not) we can refactore the stuff.

@manuel-mauky
Copy link
Collaborator

Hi,

b) The `PersonLoginViewModelNotifications' class is an enum for notifications that are used in the example. It's not realy a "viewmodel" but only belongs to the viewmodel "layer".

For the missing "View" suffix you are right. This should be adjusted.

c) I've added #347 for this task.

d) I don't know the google style guide. I will take a look at it. Another option is http://editorconfig.org/
It's a simple configuration "standard" for basic editor settings that can be shared. IntelliJ can understand the format out of the box. For eclipse and netbeans there are plugins but I don't know how good they work.
I'm using 1 tab for indentation too but maybe there are still files with other code styles in the project because we were not that careful in the past. If you fix files with double tab indentation I would be happy.

e) this is fine for me.

@manuel-mauky
Copy link
Collaborator

@Naoghuman Are you still working on the plugin? Can you give a short update?

@Naoghuman
Copy link
Contributor Author

Hi lestard,
sorry for the delay. After holiday I working first in my freetime on my own projects.

I plan for next week to refresh what the actual stand here is. But I remembered that after the refactoring from the examples it should be now possible to start with the first functionality from the plugin -> create the examples during the new wizard.

I will write an internal TODO and give you then next week an update here. Hopes that is okay?

@manuel-mauky
Copy link
Collaborator

Hi peter,
no problem. Of course this is ok. It's not time critical so you can take your time.
I just wanted to know if this is still active. I'm happy to hear that this is the case :-)

@Naoghuman
Copy link
Contributor Author

Naoghuman commented Aug 2, 2016

I see that one task is still open.

  • The refactoring from the welcome example to dependency injection example.

https://platform.netbeans.org/tutorials/nbm-projectsamples.html

  • The link is a reminder for me :)
  • The article shows the first option I write before (zip the projects and use them as examples)

@Naoghuman
Copy link
Contributor Author

TODO Refactoring welcome example:
reminder:

  • Use 1 tab instead 4 spaces.
  • Running tests before refactoring.
    • And again after refactoring.
  • Run CdiStarter and GuiceStarter before refactoring.
    • And again after refactoring.

pom:

  • Rename the tag to 'mvvmfx - dependency injection example'
  • Rename the tag to 'dependency-injection-example'
  • Remove the tag from javax.inject (its managed from parent project)

project:

  • Rename package 'de.saxsys.mvvmfx.examples.welcome' to 'de.saxsys.mvvmfx.examples.dependency.injection'
    • Rename also the package name in the 'fxml' files.

documentation:

  • mvvmFX/examples/README.md
    • Replace 'welcome-example' with 'dependency-injection-example'

questions:

  • lestard you know whether the name 'welcome example' is written somewhere in the project wiki?

@manuel-mauky
Copy link
Collaborator

Hi,
"welcome-example" is used in the dependency-injection wiki page. And in the README files of the mvvmfx-guice and mvvmfx-cdi modules. As far as I know there are no other places.

For the new package name: I think it should be de.saxsys.mvvmfx.examples.dependency_injection (with a - instead of a . between "dependency" and "injection")?

Are you planning to make this refactorings on your own or is it meant as a task list for me? :-)
Do you need any additional help?

@Naoghuman
Copy link
Contributor Author

Naoghuman commented Aug 28, 2016

Hi,
no ist a list of points for me.

a) For the new package name I will take you suggestion: de.saxsys.mvvmfx.examples.dependency_injection
b) Add the 3 documentation to the list todo documentation.

  • I see that the wiki page dependency-injection can be edit directly in the browser. So its my suggestion that when you have merge my upcoming request then I can update the links to the new name.

One point more: Is there a reason why the test-files aren't in the same package like the files to test? (with old packages, for example)

  • src: de.saxsys.mvvmfx.examples.welcome.viewmodel.personlogin.PersonLoginViewModel
    • test: de.saxsys.mvvmfx.viewmodel.personlogin.PersonLoginViewModelTest

I know it that the packages in src/ and test/ have to the same, so my question?

@Naoghuman
Copy link
Contributor Author

After holiday and through some changes in my job I come unfortunately to the decision that I haven't the time to develop this plugin. I'm sorry and wish you happy development with your project in the future.

Peter

@manuel-mauky
Copy link
Collaborator

Hi Peter,
this is sad to hear. But anyway, many thanks for the work you already have done. I think it's a good base if someone else likes to start working on a netbeans plugin again.

As we are mostly using IntelliJ at work it's unlikely that we will develope a plugin for netbeans on our own. For this reason I will close this issue now and reopen it if someone starts working on this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants