tag:blogger.com,1999:blog-6142686052821595387.post7770987716725239098..comments2018-03-05T06:23:57.299+01:00Comments on Yennick Trevels: JavaFx: Structuring your Application - OverviewYennick Trevelshttp://www.blogger.com/profile/13084772261005156419noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-6142686052821595387.post-73991151020562403142018-03-05T06:23:51.768+01:002018-03-05T06:23:51.768+01:00Hi, Great.. Tutorial is just awesome..It is really...Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from <a href="http://wisentechnologies.com/it-courses/java-training.aspx" title="Java Training in Chennai" rel="nofollow">Java Training in Chennai</a>. or learn thru <a href="http://wisenitsolutions.com/IT-Courses/Java-Training" title="Java Online Training from India" rel="nofollow">Java Online Training from India</a> . Nowadays Java has tons of job opportunities on various vertical industry.Garrick Co Idahttps://www.blogger.com/profile/11792570184576158193noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-78135104458154957452017-11-20T13:31:09.236+01:002017-11-20T13:31:09.236+01:00This Very Nice and attractive Article…
Thank you F...This Very Nice and attractive Article…<br />Thank you For Sharing This Information…<br />And also give to me important knowledge.<br /><a href="http://iphtechnologies.com/desktop-application-development/" rel="nofollow">Desktop Application Development India</a><br /><a href="http://iphtechnologies.com/iPhone-app-development/" rel="nofollow">iPhone App Development Company</a>Priti Singhhttps://www.blogger.com/profile/08836711747050321865noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-68040504924814096812014-04-16T09:40:22.075+02:002014-04-16T09:40:22.075+02:00It provide a simple but powerful pattern which wil...It provide a simple but powerful pattern which will help you to structure your application.<br /><br /><br /><br /><a href="https://www.igel.com/uk/" rel="nofollow">Thin Client Hardware</a> &amp; <a href="https://www.igel.com/uk/products/igel-zero-clients.html" rel="nofollow">Zero Client</a><br />Mark Simonhttps://www.blogger.com/profile/03604028957926441970noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-4582441364352411802013-08-24T20:17:40.324+02:002013-08-24T20:17:40.324+02:00I can see the image and open it in a new tab (even...I can see the image and open it in a new tab (even after clearing my browser cache).Yennick Trevelshttps://www.blogger.com/profile/13084772261005156419noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-85890307933907373302013-08-24T20:16:06.905+02:002013-08-24T20:16:06.905+02:00Fixed. I updated the url to the JavaFx gradle plug...Fixed. I updated the url to the JavaFx gradle plugin in the build file.Yennick Trevelshttps://www.blogger.com/profile/13084772261005156419noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-71730098725891066202013-08-24T17:49:59.579+02:002013-08-24T17:49:59.579+02:00http://dl.bintray.com/content/shemnon/javafx-gradl...http://dl.bintray.com/content/shemnon/javafx-gradle/javafx.plugin asks for user+passAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-49966043600406659752013-08-24T17:33:02.545+02:002013-08-24T17:33:02.545+02:00Broken link to: structure-flow.pngBroken link to: structure-flow.pngAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-14587081089079785662013-06-11T13:38:30.381+02:002013-06-11T13:38:30.381+02:00Awesome stuff, i used Robotlegs in tons of Project...Awesome stuff, i used Robotlegs in tons of Projects and was looking for a similar aproach in JavaFX. Thats perfect. Not quite the same without the event dispatching stuff, but close.<br />I also like building components in Flex better then JavaFX, but overall, its pretty much the same stuff.<br />Still, love Flex and always will :DJannoreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-41938091226034245232013-03-27T20:01:26.832+01:002013-03-27T20:01:26.832+01:00Because this was the most straightforward way to d...Because this was the most straightforward way to do it, I didn&#39;t want to make the initialization process more complex than it should be.<br />If you look at it from a purely architectural/theoretical viewpoint you are indeed correct that this could be better initialized somewhere else. However, sometimes I weigh the cleanest solution to the amount of complexity it adds, and in this case I thought it wasn&#39;t worth it.<br /><br />Every JavaFx developer recognizes a Main class (or any class that has a main method and which extends Application) as the entry point of a JavaFx application. That&#39;s also why I do it in there because in most cases this class won&#39;t contain all that much code.Yennick Trevelshttps://www.blogger.com/profile/13084772261005156419noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-90876328110513888082013-03-27T17:28:43.227+01:002013-03-27T17:28:43.227+01:00Hi,
Thanx for the interesting post/topic (which i...Hi,<br /><br />Thanx for the interesting post/topic (which is shamely rarely discussed by tutorials as you noticed).<br /><br />If I understand all of this correctly, your main entry point in the stack/structure of the application comes from the top (the view) :<br /><br />«<br /> Injector injector = Guice.createInjector(new EventManagerModule());<br /> EventOverviewView eventOverviewView = injector.getInstance(EventOverviewView.class);<br />»<br /><br />Why doesnt the responsibility for entering the stack (initing the commands / creating the main view, etc.) doesnt come from the Mediator/Orchestrator/Controller/Whatever ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-25857352240100561392013-03-17T12:15:06.080+01:002013-03-17T12:15:06.080+01:00The sample was made for a client-server architectu...The sample was made for a client-server architecture, so the client won&#39;t persist anything, that&#39;s the server&#39;s responsibility.<br />So the server and client use VO objects to transfer data. The server will convert (e.g. Hibernate) mapped POJO&#39;s to VO and vise versa. <br />This does indeed lead to a lot of extra code (in the form of mapper classes), but this is where mapper libraries like Dozer (http://dozer.sourceforge.net/documentation/gettingstarted.html) can help with.<br />It also has a couple of important advantages: <br />1. you can&#39;t get lazy initialization exceptions.<br />2. The view only gets the information it needs and in the format it wants to use it.<br /><br />But if you have a simple application which needs to persist something to the database which doesn&#39;t necessarily requires a server, then feel free to replace those VO&#39;s with mapped POJO&#39;s and create a service in your client which persists these.<br /><br />So in the end it all depends on the type of application you want to build. For example this architecture is a fat client architecture, but if you want to keep your business logic on the server (thin client architecture) there may be better client architectures.Yennick Trevelshttps://www.blogger.com/profile/13084772261005156419noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-88480508990167359212013-03-17T11:29:14.915+01:002013-03-17T11:29:14.915+01:00I really like the way you structure the code. It&#...I really like the way you structure the code. It&#39;s very clean, testable and easy to maintain. Besides the possibility of using some other posted libraries - I got a simple question.<br />I&#39;ve taken a look at the github repository - you&#39;re defining VOs (I guess View-Objects). How can this work together with persistent frameworks. I can&#39;t imagine any other possibility then converting the given VO to a POJO or direct sql - which both adds a lot of unnecessary code.<br /><br />What&#39;s your oppinion on this?Dennishttps://www.blogger.com/profile/08922632215761949874noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-58811966820963041332013-03-15T10:19:40.709+01:002013-03-15T10:19:40.709+01:00Yeah, just wait to see what is going to be release...Yeah, just wait to see what is going to be released next week by Mike Laboriola and the gang. (IE Joel Hooks might might be floating around this project as well).<br /><br />Its something very fun with AS -&gt; JS that you might actually think is quite interesting based on your interests of these types of design patterns.<br /><br />I have Caustic audio framework;<br /><br />http://www.teotigraphix.org/causticcore/overview/<br /><br />That is what I &quot;do&quot;, writing a cross compiler is for run. :) So I am making desktop applications to manager mobile audio apps, JavaFX has really blown me away, I thought I was going to have to go back to 2002 and use Swing! :)<br /><br />Mike<br /><br /><br />Michael Schmallehttp://www.teotigraphix.comnoreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-29987677964503960022013-03-15T09:00:21.569+01:002013-03-15T09:00:21.569+01:00It&#39;s a small world ;)
JavaFx is indeed very p...It&#39;s a small world ;)<br /><br />JavaFx is indeed very powerful (dare I say even more powerful than Flex). It has threads, the JVM languages (Java, Groovy, Scala,...), a build in Web engine (based on WebKit) and is imo architected better than Flex.<br /><br />I&#39;ve been following the Apache Flex mailing list, and you&#39;re doing some great work on the AS3 -&gt; JS part!Yennick Trevelshttps://www.blogger.com/profile/13084772261005156419noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-75619589925596472932013-03-15T08:54:33.628+01:002013-03-15T08:54:33.628+01:00Cool! I&#39;ll certainly have a look at this. Some...Cool! I&#39;ll certainly have a look at this. Something which nicely wires up FXML Controller classes with Guice was certainly missing up until now.Yennick Trevelshttps://www.blogger.com/profile/13084772261005156419noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-57819307934104720582013-03-15T00:04:10.990+01:002013-03-15T00:04:10.990+01:00I&#39;m looking for good information on IoC and pr...I&#39;m looking for good information on IoC and presentation model, I hit a robot legs guy!<br /><br />I actually ran into Benjamin&#39;s library today ironically and am going to be using it in a couple of my desktop apps, it looks well written and has a lot of possibilities.<br /><br />I still have a ways to go to wrap my head around JavaFx, been into it 2 days now but, it looks very powerful for what I need.<br /><br />Funny enough and Apache Flex comitter, working on an AS3 -&gt; JS cross compiler with Falcon.<br /><br />I will be reading your blog.<br /><br />PS I don&#39;t write any Flex code these days, but for some reason still love AS3.<br />Michael Schmallehttp://www.teotigraphix.comnoreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-11845284987334706502013-03-14T12:14:17.736+01:002013-03-14T12:14:17.736+01:00I also thought about best practices for the struct...I also thought about best practices for the structure of my JavaFX apps. I fully agree with Ajay V. that the use of FXML Controller classes is (in many cases) a good solution when separating application logic from actual UI elements.<br /><br />I created a small framework to ease the integration of Guice into your JavaFX applications a while ago (It&#39;s called: &quot;fx-guice&quot;).<br /><br />--&gt; https://github.com/cathive/fx-guice<br /><br />By extending &quot;GuiceApplication&quot; instead of &quot;javafx.app.Application&quot; you gain a bunch of advantages:<br />* You can @Inject your app object anywhere as it will be<br /> automatically bound<br />* You can use the GuiceFXMLLoader to load FXML files and use both<br /> @FXML and @Inject annotations in your FXML Controller classes<br />* You can use @FxApplicatioNThread to mark methods that must be<br /> executed on the JavaFX event dispatch thread<br />* ...<br /><br />&quot;fx-guice&quot; is published under the Apache License v2.<br /><br />Source code can be found on Github and ready-to-use artifacts can be found in the Sonatype OSS Maven repository. I also uploaded some (very simple) example apps (e.g. a cute little calculator) that shows how to use my framework.<br /><br />--&gt; https://github.com/cathive/fx-guice/tree/master/examples/calculator-example-app<br /><br /><br />I feel that writing the common boiler plate code over and over again is kind of boring and it&#39;s really time for a proper Guice extension to deal with JavaFX integration. :-)Benjamin P. Junghttps://www.blogger.com/profile/05497231550318798788noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-44192947387377200302013-03-11T15:08:00.299+01:002013-03-11T15:08:00.299+01:00@tbee I think we both describe a valid architectur...@tbee I think we both describe a valid architecture which can be used depending on the requirements of the application. Correct me if I&#39;m wrong, but it looks like you are describing an architecture for a thin client (where the business logic is located on the server), while my architecture is for fat clients (business logic in the client).<br />So in my case the client will be more complex (therefore the command layer), while your solution doesn&#39;t need that because the business logic is on the server.Yennick Trevelshttps://www.blogger.com/profile/13084772261005156419noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-82432140525035652992013-03-11T14:24:29.295+01:002013-03-11T14:24:29.295+01:00Making sure the UI stays responsive is indeed the ...Making sure the UI stays responsive is indeed the responsibility of the backing bean; it knows when it can simply wait or put stuff in a separate thread (and provide a feedback on progress). Of course some utility code to prevent scaffolding is needed, but it&#39;s all part of the UI layer. Naturally there should be no business logic in the backing bean, just the code connecting the UI to the model. Any business logic is part of the rich domain model. <br /><br />About the class growing; kinda depends on the JFX screen, but with loads of controls the backing bean can become bigger, yes. Hard to avoid. The per-control code still remains constrained to max 5 lines or so. On the other hand, a pile of interfaces don&#39;t make things more readable either.tbeehttps://www.blogger.com/profile/02676132703267756531noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-27441853843743254652013-03-11T13:01:52.683+01:002013-03-11T13:01:52.683+01:00We can KISS(Keep it simple , stupid) by making use...We can KISS(Keep it simple , stupid) by making use of FXML - Controller class and simple methods that makes the CRUD operations.ajay vasudevanhttps://www.blogger.com/profile/02193817654781831941noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-44497626139637504902013-03-11T11:26:37.167+01:002013-03-11T11:26:37.167+01:00If you would do all that in your backing bean then...If you would do all that in your backing bean then it can become a rather big class, which makes it harder to unit test (more dependencies, more code, ...).<br />Also, you would have to make sure that in your backing bean all the logic/remote calls that can take some time are executed in a separate thread to not block the UI, which further clutters your code. In my approach this is nicely separated in the command layer.Yennick Trevelshttps://www.blogger.com/profile/13084772261005156419noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-25107180024810501422013-03-11T10:26:37.734+01:002013-03-11T10:26:37.734+01:00The approach is too layered for my taste; I&#39;d ...The approach is too layered for my taste; I&#39;d like to keep it simpel. <br /><br />Given that the view is defined in a FXML file (or setup manually), then the mediator would be a controller or backing bean. If the &quot;delete contact&quot; button is pressed, for me, the backing bean should do a (skipping null checks):<br /><br />em.find(Contact.class, 123).remove();<br /><br />And on success also remove the contract from the list in the backing bean populating the JavaFX ListView control (or maybe do a JPA query to repopulate). <br /><br />If you want to go enterpricy and move the whole business model onto its own application server, then the backing bean talks to that API directly. Say a REST interface:<br /><br />http[DELETE]://appserver/contact/123<br /><br />I&#39;d drop the command layer completely.tbeehttps://www.blogger.com/profile/02676132703267756531noreply@blogger.comtag:blogger.com,1999:blog-6142686052821595387.post-72522903659189714622013-03-11T04:53:58.593+01:002013-03-11T04:53:58.593+01:00Glad to see this. Cool approach too. Best practice...Glad to see this. Cool approach too. Best practices for structuring JavaFX apps really haven&#39;t been established yet, so it is good to see some posts on the topic emerging.edubkendohttp://nodehed.com/noreply@blogger.com