Seperating presentation from 'business logic'

I have a program for keeping track of games played and keeping a league table. However, I currently think the way I do the output of the league table using the toString() function shown later is a pretty poor way to do it. OK, let's be honest, it sucks!
My idea is to have some sort of intermediate function which, say generates a structure with just the basic information and then have some other function which displays that info. The basic information might be in the format of an array (one row per player) where each row is a map ('name'->name info, 'grade'->grade info).
But I dunno. I welcome your OO ideas for doing this nicely!
Bear in mind I'm still fairly new to Java please ;-).
Thanks.
RANK LIST
1. 1160 Alactaga (1160) (played 2)
2. 1131 Brius (1131) (played 8)
3. 1111 Chadi (1111) (played 3)
4. 1073 Killer Giraffe (1073) (played 7)
5. 1071 Fitzchev (1071) (played 6)
6. 1053 Dragon (1053) (played 3)
7. 1003 Marco d'Orange (1003) (played 2)
8. 1000 HOrace (1000) (played 2)
9. 1000 Coboi (1000) (played 0)
10. 976 Mimick (976) (played 3)
11. 950 Penestratus (950) (played 1)
12. 947 Computer (947) (played 1)
13. 944 Petit Gayole (also known as ETP Migrator) (944) (played 3)
14. 919 Tartarus (919) (played 2)
15. 918 Black Jack III (918) (played 6)
16. 839 Heraldo (839) (played 4)
17. 822 Aragorn (822) (played 5)And the code that generates it:
* Created on 22-sept.-2003
package core;
// Java imports
import java.util.*;
* @author priorhu
public class League extends Players {
     private static final int BASIC_SWING = 50;
      * Main routine for recalculating rankings based on a given game
      * Pour le rating, voici ce que je [Didier "Chadi" Charneux] propose,
      * c'est pas tr?s compliqu?.
      * La m?thode de calcul est la suivante :
      * 1/ calculer le ratio entre l'?quipe gagnante et l'?quipe perdante (ratio = points ?quipe perdante / points ?quipe gagnante).
      * 2/ multiplier ce ratio par lui-m?me pour que ce soit significatif (Ratio sig = ratio**2)
      * 3/ multiplier le r?sultat par 50 (points= ratio sig * 50)
      * 4/ ajouter les points aux gagnants et les retirer aux perdants
      * Exemple : Team A 2500 points, Team B 3000 Points
      * Team A gagne                    Team B gagne
      * 3000 / 2500 = 1,2                2500 / 3000 = 0,8
      * 1,2 * 1,2 = 1,44                     0,8 * 0,8 = 0,64
      * 50 * 1,44 = 72                     0,64 * 50 = 32
      * +72 points pour les gagnants      +32 points pour les gagnants
      * -72 points pour les perdants      -32 points pour les perdants
      * @param game
      * Created on 22-sept.-2003
     public void scoreGame(Game game) {
          Iterator playersIter;
          Team winningTeam = game.getWinningTeam();
          Team losingTeam = game.getLosingTeam();          
          double winnersGrade = winningTeam.getTotalGrade();
          double losersGrade = losingTeam.getTotalGrade();
          double swing;
          swing = losersGrade / winnersGrade;
          swing = swing * swing;
          swing = swing * BASIC_SWING;
          int roundSwing = (int) swing;
          System.out.println("Grading change: " + roundSwing
               + " calculated as follows: "
               + BASIC_SWING + " * (" + Math.round(losersGrade) + " / " + Math.round(winnersGrade) + ")**2");
          regradePlayers(winningTeam, roundSwing);
          regradePlayers(losingTeam, -roundSwing);
          System.out.println("");
      * Regrade each of the players in the given team
      * @param team
      * @param delta
      * Created on 06-nov.-2003
     protected void regradePlayers(Team team, int delta) {
          Set players = team.getPlayers();
          Iterator playersIter = players.iterator();
          while (playersIter.hasNext()) {
               Player teamPlayer = (Player) playersIter.next();
               Player leaguePlayer = this.getNamed(teamPlayer.getName());
               int oldGrade = teamPlayer.getGrade();
               int newGrade = oldGrade + delta;
               // Before
               System.out.print(leaguePlayer + " => ");
               // After
               leaguePlayer.setGrade(newGrade);
               leaguePlayer.notePlayed();
               System.out.println(leaguePlayer);
               this.put(leaguePlayer.getName(), leaguePlayer);
      * Create a string version of the ranked list
     public String toString() {
          String rankListString = "";
          rankListString += "RANK LIST\n";
          rankListString += "---------\n";
          Collection players = this.values();
//          System.out.println(players);
          Player[] playersArray = new Player[players.size()];
          Iterator playersIter = players.iterator();
          int playerNo = 0;
          while (playersIter.hasNext()) {
               playersArray[playerNo++] = (Player) playersIter.next();
          Comparator rankComparator = new Comparator() {
               public int compare(Object o1, Object o2) {
                    int comp;
                    Player p1 = (Player)o1;
                    Player p2 = (Player)o2;
                    if (p1.getGrade() < p2.getGrade()) {
                         comp = 1;     
                    else if (p1.getGrade() > p2.getGrade()) {
                         comp = -1;
                    else {
                         comp = 0;
                    return comp;
          Arrays.sort(playersArray, rankComparator);
          for (int pNum = 0; pNum < playersArray.length; pNum++) {
               Player player = playersArray[pNum];
               rankListString += (pNum + 1) + ". " + player.getGrade() + " " + player.toString() +  "\n";
          return rankListString;
}

Assuming you add an a method called something like getData() that returns a 2 dim array with each row being a players. Something like the following:
import com.fdsapi.ArrayComparator;
import com.fdsapi.FormattedDataSet;
public class League extends Players {
  // I'll hardcode array.  I'm guessing at
  public Object[][] getData() {
    Object[][] players={
                                      {new Long(1160), "Alactaga", new Long(2)},
                                      {new Long(1111), "Chadi", new Long(3)},
                                      {new Long(1131), "Bitius", new Long(8)},
    return players;
  // Using the FormattedDataSet to sort the array and display the data. 
  public String getReport() {
     Object[][] players=getData();
     // sort by column 0 in descending order
     ArrayComparator.sort(players, 0, "desc");
      // The following declaritive syntax says to display all rows according to the last parameter.
      // ##rowNum - dynamically substitute the the current row.
      // ##colnum - displays the data for a column (indexed starting at 1)
     Template template = new Template();
     template.initialize("body_row_data",0,0,"##rowNum. ##1 ##2 (##1) (played ##3)");
      // This will return the same report you did in your code.
      FormattedDataSet fds=FormattedDataSet.createInstance();
      return fds.getFormattedDataSet(null, players, template);
}Note the FormattedDataSet is much more powerful than this. Out of the box it can do html tables, xml, drop down listboxes, lisboxes, radio buttons and more. Plus you can easily create your own templates like the above.
For a live demo and to download check out: http://www.fdsapi.com

Similar Messages

  • Separating presentation from business logic.

    I recently wrote an article on how to separate JSP presentation from the business logic without a complicated framework.
    http://labs.revision10.com/?p=16
    I haven't seen this exact approach taken before, but believe it works fairly well for most simple web applications. Applications which tend to attract many developers to PHP do to its simple architecture.
    What are your thoughts on this approach?
    Thanks!

    Here goes the answers to your question. (according to my knowledge)
    1. Deciding a server is depends on your design of the application. According to point 3, you are better to use JMS with publish and subscribe model. In this case you have to choose a JMS server that supports your needs
    2. Again it is depends on your Design, one way is to put a shared memory for data and write a thread that reads from the shared memory or use java.net package or use JMS etc.
    3. Create one JMS source and all other will be JMS destinations.
    4. You can use EJBs or Java classes based on your requirements and design to process the data.
    5. Using AWT or Swing as a presentatin layer is good. But you desperately want to display it using Win 32 objects, then why dont to go for Microsoft technologies??

  • Seprating Persistence logic from business logic

    Hi all !!
    I was thinking about that is there any known way or a possible way by which i can write a Entity Bean in which i can seprate the business logic and Persistence logic. Like what if i want to decide at the deployment type whether my Bean is gonna be BMP or CMP.Becuzz it may be possible that CMP may work fine with a particular container but does'nt work with some other vendor's container , so at the deployemnt time i can juzz switch it to BMP rather than CMP.
    Any comments?
    Thankzz

    Greetings,
    Hi all !!
    I was thinking about that is there any known way or a
    possible way by which i can write a Entity Bean in
    which i can seprate the business logic and Persistence
    logic. Like what if i want to decide at the deploymentYep! It's called a DAO (Data Access Object). Of course, this is only useful for BMP beans...
    type whether my Bean is gonna be BMP or CMP.Becuzz it
    may be possible that CMP may work fine with a
    particular container but does'nt work with some other
    vendor's container , so at the deployemnt time i can
    juzz switch it to BMP rather than CMP.
    Any comments?Absolutely. First implement your bean class for CMP, then extend from it to make a BMP version. Then during assembly/deployment select the version appropriate to the environment. You can increase your application's portability even further by encapsulating the persistence logic in a DAO which could then be accessed from a JavaBean in JSPs/servlets (or applications) directly. :)
    ThankzzRegards,
    Tony "Vee Schade" Cook

  • Push messages from business logic into backing bean

    In my simple web application a table with the contents of a database table is shown to the client. Now I want this table in the browser to be updated each time the db table is updated. In my business logic a jms message is fired to a specified topic each time the db table is updated. The reverse ajax stuff needed for the client update is provided by the Icefaces jsf implementation. There is a backing bean for each session which is responsible for the server side rerendering of the client. Now my question is: How do I connect the bussiness logic firing a jms message if the db table is updated, with the backing bean?
    My thoughts:
    1. Create a message listener for the topic. Each time the message listener receives a message it notifies the backing beans of each session to rerender the client. But how does the message listener know about the backing beans?
    2. The backing bean responsible for rerendering the client adds itself as a listener. But where? As I understand it cannot be a backing bean and a jms MessageListener at the same time.
    Has anyone an idea/pattern for this problem?

    You could keep a list of beans that need to be notified in the application scope. (You should probably use weak references so that they may be garbage collected.) Then you JMS listener could get access to them.
    Somebody posted a thread recently where they were doing something very similar, you might want to try to find it.

  • Urgent: how to really seperate business logic class from data access class

    Hello,
    I've this problem here on my hand and i really need help urgently. so please allow me to thank anyone who replies to this thread =)
    Before i go any futhur, let me present a scenario. this will help make my question clearer.
    "A user choose to view his account information"
    here, i've attempted to do the following. i've tried to seperate my application into 3 layers, the GUI layer, the business logic layer, and the data access layer.
    classically, the GUI layer only knows which object it should invoke, for example in the case above, the GUI would instantiate an Account object and prob the displayAcctInfo method of the Account object.
    here is how my Account class looks like:
    public class Account
    private acctNo;
    private userid;
    private password;
    private Customer acctOwner;
    the way this class is being modelled is that there is a handle to a customer object.
    that being the case, when i want to retrieve back account information, how do i go about retrieveing the information on the customer? should my data access class have knowledge on how the customer is being programmed? ie setName, getName, setAge, getAge all these methods etc? if not, how do i restore the state of the Customer object nested inside?
    is there a better way to archieve the solution to my problem above? i would appriciate it for any help rendered =)
    Yours sincerely,
    Javier

    public class AccountThat looks like a business layer object to me.
    In a large application the GUI probably shouldn't ever touch business objects. It makes requests to the business layer for specific information. For example you might have a class called CustomerAccountSummary - the data for that might come entirely from the Account object or it might come from Account and Customer.
    When the GUI requests information it receives it as a 'primitive' - which is a class that has no behaviour (methods), just data. This keeps the interface between the GUI and business layer simple and makes it easier to maintain.
    When using a primitive there are four operations: query, create, update and delete.
    For a query the gui sets only the attributes in the primitive that will be specifically queried for (or a specialized primitive can be created for this.) The result of a query is either a single primitive or a collection of primitives. Each primitive will have all the attributes defined.
    For a create all of the attributes are set. The gui calls a method and passes the primtive.
    For an update, usually all fields are defined although this can vary. The gui calls a method and passes the primitive.
    For a delete, only the 'key' fields are set (more can be but they are not used.) The gui calls a method and passes the primitive.
    Also keep in mind that a clean seperation is always an idealization. For example verify that duplicate records are not created is a business logic requirement (the database doesn't care.) However, it is much easier and more efficient to handle that rule in the database rather than in the business layer.

  • Seperate business logic from application logic

    Hi guys,
    I am looking for a good article explaining the princiaples of seperating between Business Logic & Integartion logic.
    The articale will be used to exlplain the prinicples SAP PI is based on when it comes to integration between 3rd party systems (Non -SAP) missign the application layer and buisness logic.
    If any one has a link to an article as such.
    Will be most appriciated.
    Regards.
    Nimrod Gisis

    It seems that the general rule to making a GUI
    application is to seperate the "Business Logic" from
    the "Presentation Logic". This is absolutely true.
    From this, I'm guessing I'll
    need to package all my GUI stuff together, and all the
    business logic layer stuff together.If you mean the package names and structure then I would had adapted this structure:
    1. I will have a package under which I will put the application common classes and interfaces.
    com.myapp.common.eventhandler.EventHandler (interface)
    com.myapp.common.eventhandler.AbstractEventHandler (default implementation)
    com.myapp.common.form.Form (interface)
    com.myapp.common.form.AbstractForm (default implementation)2. Create for each subject area its own package:
    com.myapp.product.AddNewProductForm
    com.myapp.product.AddNewProdcutEventHandler
    com.myapp.sales.PriceListEeventHandler
    com.myapp.sales.PriceListEeventHandler
    The GUI will then talk to the Biz lay through an
    interface right?As I illustrated through my previous example, you should have common interfaces and you might need to create Abstract classes that encapsulates the common implementation for these interfaces, then for each GUI Form or Web Page you will create its specific implementation class which inherits from the abstract class.
    Finally if you were asking about the deployment packaging:
    1. Create for each EJB its own jar file then bundle these Jar files under one module jar file, which represents the EJB module.
    2.Package the web application (JSP, Servlets, HTML, Images, CSS, and Java script) in one Web module WAR file.
    3. Package your client application module in its own jar file.
    4. Assemble the EJB module Jar, Web module War, and Client module Jar in one J2EE package which will be an EAR file so that your whole package will be assembled in one EAR file at the end.
    Try the "Application Assembly Tool" which comes with WebSphere. It will organize your application and facilitate this kind of integration.
    - Sherif.

  • Does Jheadstart retain Business logic after migrate from form9i

    Hi
    I wish to do convertion from oracle form9i into Jheadstart
    MVC framework, I knew from doc, business logic can be emmbebed inside the Bc4j entities manually, but how far does jHradstart able to retain the original business logic inside those 9iforms if i would like to do convertion thru reading designer repository which i build from a reverse engineer process.
    please advice
    Keatmin

    Dear Ramana,
    The functionality you are looking for is called Design Capture (Forms definitions into the Designer Repository). This functionality can be found in the Oracle Designer tool Design Editor.
    Design Capture reads the Form definitions (fmb files) and creates Module Definitions in Oracle Designer. The module definitions contain Module Components, Items and the links to tables and columns. PL/SQL code in the Form is design captured as Application Logic into Designer.
    The JHeadstart Designer Generator will read the Module, Module Component, List of Values and Item definitions from Designer to migrate to a JHeadstart Application in JDeveloper.
    You do not access Forms directly from JDeveloper.
    best regards,
    Lucas Jellema

  • How to design application to decouble business logic from GUIs on SAP N7.0

    Hi guys,
    How should I go about designing a program, so that I can decouple the business logic from GUI in ABAP in such a way that I can change the GUI easily or use different GUIs eg. on a scanner etc..

    You may use BDT (business data toolset). It's rather complex. Or use web dynpro but also complex. Or you can program it by yourself (much less difficult).

  • Segregating business Logic from JSP files.

    I have an application with around 150 jsp files, out of which almost half of them are containing business logic.
    I am actually in a process of segregating the java code from the jsp files.
    Could you please guide me in finding out the best practices, dos and don'ts while engaging in such a process.
    Thanks in Advance

    I've been through this hellish experience. I’m not sure any “best practices” for this exist.
    gimbal2 idea of starting a new project would be ideal, if costly. The other extreme is “it works”, don’t touch ‘em until you need to change the functionality then work out the cost/befit of a rewrite for that slice.
    If you really want to take this route:
    How bad is the code that does not live in the JSPs? Should it be reused or avoided?
    What level of functional test coverage do you have?
    The approach my team and I took was to cut it down into slices and try to rewrite that slice as cleanly as possible. Where interactions between slices exist try to write a facade which calls the legacy code but looks like how you would want the new code to look.
    This did not work perfectly. The facades were rarely used well and we had to drop major slices of work to complete on time leaving us with large chunks of legacy code that we can’t delete.
    We started with no automated functional tests, but a goal of getting to a decent amount. We failed on this, which caused major issues - mop up lasted a month and a half after release. Drop functional slices to ensure that you end up with a solid set of automated tests. If you can not get your team to buy into this don't bother with the project.

  • Passing Parameters from Scheduler to a Business Logic tranaction

    Does anyone have any tips or tricks regarding passing a value from the xMII Scheduler to a Business Logic Transaction Property.
    I can see the property in the Parameters section of the Scheduler, and I can enter a value against it.  But it doesn't ever reach the BL Transaction when the transaction is triggered.

    I'm on 11.5.1 b54
    Created a simple BL transaction that contains one string Transaction Property.
    I have one action block that has a text saver action that links the Transaction Property to the StringContent property of the action and saves the file.
    If I configure the Transaction Property with some text and then execute the BL transaction, the text appears in the file created by the text saver.
    If I configure a scheduled job, enter text against the property in the scheduler and then run the job, the text configured in the BL transaction property (not the text in the scheduler) appears in the file.
    If I delete the text from the Transaction Property and run the job, no text appears in the file.
    Should I be able to pass a simple text string to a transaction property on this version of xMII?

  • Future support for using PL/SQL core business logic with ADF BC

    We want to migrate our large Forms client/server (6i) application to ADF, possibly using a migration tool like Ciphersoft Exodus.
    One scenario could be to use ADF BC and ADF-Faces or a different JSF-Implementation for presentation and business layer but keep our heavy PL/SQL-businesslogic inside the Oracle database in packages, triggers, functions and procedures.
    This scenario could be chosen due to the huge amount of interconnected logic inside the database (10 years of development; no technical components; any package may access any table and more of this kind of dependencies). The business logic nowadays held in Forms client will be moved mainly into the database as a prerequisite to this scenario.
    Choosing this "keep-logic-in-DB"-scenario we need a good support by ADF BC to do so. We know and prototyped that it is possible to call some PL/SQL via JDBC from ADF BC and it is possible to use stored procedure calls for standard business entity data access (ins, del, upd, ..). But this does not solve our problems. We want to reuse core business logic coded in PL/SQL. This is much more than change the ADF standard behavior for an update with an own PL/SQL-call.
    Now my question:
    Will there be a kind of sophisticated support to use ADF BC in combination with database-kept logic?
    If so, when will this happen and how will the common problems of transactional state inside the database and inside the ADF BC be solved? Any plans or ideas yet?
    Many other clients do have similar applications built in Forms and PL/SQL and would be glad to hear about a path of direction.
    I've read the technical article 'understanding the ADF BC state management feature' which you have contributed to. One current limitation is pointed out there: Using PL/SQL with ADF BC limits ADF AM pooling to 'restricted level' which reduces scalability.
    Are you aware of additional main problems/tasks to solve when using PL/SQL heavily with ADF BC, which we have to think about?
    Thank you for any response.
    Ingmar

    My main problem is two 'concurrent' areas holding state in an application system based on DB-stored PL/SQL-logic in combination with ADF BC.
    For a new System everything can be made ok:
    Sure, it is possible to build a new system with the business logic included in ADF BC only. All long-living state will be handled in the BC layer ( including support for UnitsOfWork longer than the webside short HTTP-requests and HTTP-sessions and longer than the database transactions.
    For an old system these problems arise:
    1. DB data changes not reflected in BC layer:
    Our PL/SQL-logic changes data in tables without notifying the ADF BC layer (and its cache). To keep the data in ADF BC entity objects identical to the changed database content a synchronization is needed. BC does not know which part of the application data has been changed because it has not initiated the changes through its entity objects. Therefore a full refresh is needed. In a Forms4GL environment the behavior is similar: We do frequently requeries of all relevant (base)tables after calling database stored logic to be sure to get the changed data to display and to operate on it.
    -> Reengineering of the PL/SQL-logic to make the ADF BC layer aware of the changes is a big effort (notifying BC about any change)
    2. longer living database transactions
    Our PL/SQL-logic in some areas makes use of lengthy database transactions. The technical DB-transaction is similar to the UnitOfWork. If we call this existing logic from ADF BC, database state is produced which will not be DB-committed in the same cycle.
    This reduces scalability of ADF BC AM pooling.
    Example:
    a) Call a DB-stored logic to check if some business data is consistent and prepare some data for versioning. This starts a DB-transaction but does not commit it.
    b) Control is handed back to the user interface. Successful result of step a) is displayed
    c) User now executes the versioning operation
    d) Call another DB-stored logic to execute the versioning. DB-transaction is still open
    e) Business layer commits the transaction automatically after successful finishing step d). Otherwise everything from a) to e) is rolled back.
    -> redesign of this behavior (= cutting the 1to1 relation between LogicalUnitOfWork and the technicalDatabaseTransaction is a big effort due to the big amount of code.

  • Problem in Business Logic Callable Object execution

    Hi All,
    We are working on a workflow scenario where 2 approvals are present. Second approval is optional.
    Second approval is required or not is decided by a business logic callable object.
    This callable object is assigned (user role0 to initiator.
    Issue is, when first approval is completed, flow goes to business logic callable object. A UWL entry comes in initiators inbox. And from there, flow doesn't move forward. It simply shows message 'The next activity is not yet available: try again later using the "Refresh" button".
    I have tested this business logic callable object individually, and it works fine.
    But in process, it doesn't move further.
    What can be the solution to this?
    Thanks,
    Deepti

    Hi,
    I have the similar issue.
    In my case it is taking too much time for completion.
    It is a background step so it should execute automatically.
    I have also checked Queue's for this.
    But could not understand why it is taking soo much time?
    Regards,
    Pratik

  • Business logic in Database layer or in Middle layer.

    I am converting my form 6i client server application to .net 3 tier web architecture application using oracle 10g database.
    My application is a very data centric, millions of records calculations happen in many processes.
    I have a problem while presenting my design approach to engineering board in my company.
    Approach 1
    Put business logic in backend database layer.
    I proposed to put business logic in backend packages rather than putting it in middle .net layer and create web shell services in middle layer which would call these packages and show the data on screens.
    Approach 2
    Put business logic in middle tier .net layer.
    My company engineering board are more keen for this approach because they think this is the latest approach and now days nobody put business logic in database and moreover we would be having clear separation between data and logic.
    But my concern is we may have network latency issues in approach 2 because we need to move millions of records data back and forth between database and application server.
    Could you please suggest, which approach is best and why?

    My views:
    1. If it is a data centric operation, like you have mentioned, it will be a bottleneck to transfer the required data to middle tier for processing
    2. If you are going to support one and only one RDBMS as a backend ever, I don't see a reason to take an approach which is mostly taken in case one needs to support databases from different vendors as back end.
    3. If you are convinced that yours is the only application that would ever connect to this database, then you can add the business logic in the middle tier; If not, let it be in the database in form of triggers/procedures/functions/packages etc.
    4. Last but not the least, having business logic in the database would call for faster processing and that you can use all features of that particular RDBMS to full extent, in case needed.
    I always support having the business logic in the database layer (not that I hate business logic in application/middle tier) but there can be exceptions.
    Just my two cents :-)

  • ADF11g: business logic in ADF BC or PLSQL?

    Hi All,
    For a new development in ADF 11g , where we should put our business logic: In ADF BC or in PLSQL?
    What if we write all the bussiness logic in plsql? Because if tomorrow ADF goes(which I know is not ging to happen soon), we can expose pl/sql as web services, and new UI technology can use it. And we will not struggle on migration, as we are struggling today from Forms to ADF.That's what my manager says......
    Though I know that we can write our business logic in ADF BC, and that too can be exposed as web service.
    But I still need more suggestion on this, which one is better to write bussiness logic.
    Thanks
    Vikram

    We have a team with mixed skill sets, so consequently some of our business logic is in ADF/BC and some is in PL/SQL.
    Having some in PL/SQL allows my project manager to divide and conquer the work to be done on an adf project easier than I can train the pl/sql guy to be an adf guy...supposedly.
    Also our project manager is also a techy with a primarily pl/sql orientation.
    I like Java better because it is new and fun for me, but that is not much of a reason.
    I have been to many presentation's of Paul Dorsey's BRIM product. Paul is absolutely certain that you and your manager are doing good when you put business logic in the database. Paul goes even further. I respect him and his arguments are sound.
    I still like Java better...mostly because I have done pl/sql for ages and am tired of it. :-)

  • Data dinding to non JFX objects - bind to business logic

    Hi,
    I want to seperate my underlying model clearly from JavaFX. This obviously means, that my model is plain Java. So I tried to bind the selected-value of a checkbox to a boolean value of a field of one of my Java classes. Unfortunately this does not work. Is this true? Is a binding only possible to variables which are defined inside a .fx file?
    And as another question, do you know a good tutorial concerning the usage of existing business logic with JavaFX?

    Hi raltlan,
    You says: you can't bind directly to Java classes.
    I didn't understand exactly, what you mean.
    I'm developing an application, that confirms to MVC pattern.
    It seems, it's well possible to keep data and presentation layers separated, even with JFX SDK ver. 1.0
    As far as I understood:
    You can bind to any Java classes.
    Here, better if we distinguish between Java's UI and non-UI related classes.
    Using UI-related Java APIs needs a little bit more coding (there are good samples available about how to do it.)
    Binding to instances of non UI-related Java classes is easy. See Blog of Michael Heinrich at following links about JFX – Java interaction:
    http://blogs.sun.com/michaelheinrichs/entry/writing_java_for_javafx_part (Writing Java code for JavaFX Script)
    ... and for other direction of interaction:
    http://blogs.sun.com/michaelheinrichs/entry/using_javafx_objects_in_java
    Taking care about direction of Java - JFX interaction is helpful to avoid problems (and unnecessary loose of time).
    As already known, it's better to embed Java code into JFX code (JFX code calls Java code).
    Regards,
    Asghar

Maybe you are looking for

  • Getting SOAException while calling SOA web service via pl/sql procedure

    Hi All, I created a 'Helloworld' BPEL process and successfuly deployed it. I tested it in the WLS and it is working. Now I wrote a pl/sql procedure which calls this 'HelloWorld' bpel process. When ran this procedure it throw me an error GetPayload: r

  • Why is the New FireFox so different to the previous version?.

    Prior to upgrading if I brought up my FireFox page I had a header the same as my Google Page. The new/latest FireFox Page does not have the header with the options. Those options were,Images-Videos-Maps-News-Shopping-Mail and a More option with a dro

  • WTC FAQ

    Here are some common WTC questions and answers: Q1: What is the transaction story for WTC between WLS and Tuxedo and how does it differ from Jolt? A1: In version 1.0 of WTC transactions may be started in WLS and will "infect" Tuxedo with the same tra

  • Muse crashed and afterwards, error message saying site file damaged and will not open

    I was working on a muse file when it shut down due to "an error". When I tried to open the file again, it told me that the site was damaged and could not be opened. I have a PC and I would like to know if there is any way I can get the file checked o

  • Broken DC's after ess import

    Hi What are broken DC's? We have configured JDI for ESS web dynpro customizations in EP7 and we see about 210 Broken DCs. Do you think i should proceed with web dynpro customization with brokec dc? or do i have to reimport the ess .sca files? Please