I made an Application in JavaFX which has two different TableViews. These TableViews are connected. The Table View "Dealers" has variables like String name, String Adress etc., but it also has an ObservableList of rating Objects. These Rating Objects are dynamically displayed in the other TableView trough listeners which react to the seller which is selected.
I need an easy way to save and load these Seller Objects. Using JDBC i tried to setup a database but couldn't deal with the ObjectList variable in the Seller Object. I am a beginner in Java programming and a simple offline save and load option would be enough.
My Question: What is the simplest way to offline store and and load these Seller Objects?
Thank you in advance.
Image of JavaFX Application
Related
I am 100% new to ASP.NET and I've been working on this problem for a few weeks. I'm trying to have a very barebones website that when loaded will prompt the user for their dessert preference. If they like cakes, the website will display cake photos, if they like jelly, it will display jelly.
My first thought was to start with the SQL database. It has two tables, Jelly and Cakes, both have the same format for columns.
An integer for id, a varchar for name and a binarydata for storing the image.
Then I created the website on ASP.NET. I started by generating a ASP.NET Web App (MVC) in Microsoft Visual Studio. I tried to create a model class called Dessert that would create a dataset of either Jelly or Cakes dependent on what the user choose but I couldn't figure out how exactly to create that.
I went online and read some documentation and apparently ASP.NET can auto generate a SQL database based on your model? I toyed around with creating different models, trying to connect the model to my SQL database, auto-generating the SQL database with ASP.NET but I'll be honest and say, I haven't got a clue what I'm doing.
My initial feeling was to create a model, have some sort of starting page that asks the user their preference, the Dessert class gets made based on the user's preference and the webpages are dynamically displayed with whatever their preference was.
Any help on this would be appreciated. Even if it's just a link to a resource that can help me.
Thanks.
This involve many steps --
You create the db
Create Web Project
Add Option to connect with Database, you can use (Entity Framework, Plain ADO.NET, Dapper)
Create a db class to make methods that call db
Create model class to hold data returned from db
Create controller and call db class to get data and pass it to view
Create MVC view to show data and capture user intergation
For you use case I allready prepared some code and database, please look into this repo --
https://github.com/mataprasad/MyDesserts
We are revamping a big enterprise application which has more business workflows. We are using activiti bpm with spring MVC. Currently we are saving the required variables for workflow inside execution individually. My idea is to create object for each workflow and save the object as variable inside activiti execution instead of individual variables.
For example for the job application workflow I will have JobRequest object which have all the requested details like approvers, interviewers, candidate profiles, current status, etc., I will save this object as variable inside activiti. Whenever I need I will just get the object back and show the needed info on the web page. It will be hassle free than maintaining all those information on separate tables and getting the reference alone from activiti.
Is this good approach?
Still I have some concerns on my approach.
If suppose later we add additional fields to the Class. Then how to
handle the history object variables. (In the above example we are
adding additional field under JobRequest.class).
In our current approach if some values really needs to be verified I
can connect to the activiti database and able to see. Because the
variables are saved individually.
Any valuable suggestion?
Upon attempting to populate a grid on the UI layer, the UI asks the BI layer for a list of results, EF returns the list of each result, and they are cast into a DTO that pulls in some additional information, this is converted to a list and returned to the UI layer.
The performance is impossibly slow. EF is creating a new context and hitting the DB for each individual result. This is because the DTO class will create a new dbcontext each time it is initialized if it is no longer open/active. Finalization of the class closes out the context. I believe this is what is killing performance.
Is there any way to batch something like this? In SQL i would performance a JOIN on the tables i need to get the resulting data loaded into a dataset. In EF when i create the DTO i then access the mapped objects relations and access data from other objects as such.
How should I access a large amount of records via EF to be returned to a UI layer grid when i need to access some information that is not stored in that particular entity object? (an example of this would be having a relation between users -> customers via the customer_userID -> userID PK. And wanting to display the User's Name, once i have the Customer object i need to then query the User object for the Users name in relation to that ID.
Anyone have any articles that can point me the correct way?
Functions that were passing a large amount of data to the UI layer were causing the issues. Often because the object from the DB layer had to have some operations performed on it before it could be passed to the UI layer. In essence some of the list generating functions were causing the store to create a new context for each individual request.
Just-in-time paging was one performance boost, so as to request a starting offset and a record count. What is important to note there is we had to create functions to simply return the total counts so the UI grids knew how many records they were dealing with.
The next fix was on the functions that apply BI rules to the objects before they are passed to the UI layer. In these cases we open a new context and pass that into the function, so it uses that context and only closes it out after the results are all completed.
I am currently undertaking an exercise to research on a number of JS MV* frameworks and select one that best suits the team's needs. Knockout is one of the contenders that I am learning about.
One of the most important requirements is for changes in the data in a view model to be broadcast to all the views that use such data. For example, lets say we have client details listed in a data grid on a page, clicking on any row in the data grid brings up a pop-up dialog where the user can edit the values of the selected row. When the change is made and the user clicks 'Save', the data is updated in the database. But what we also want is that the change be reflected in the local ko.observablearray and then for any other views that use this 'clients' collection to refresh themselves with the new data. In other words the views must refresh themselves with the data in ko.observablearray rather than get a fresh list from the database.
I have been successful in doing this - have one a single .cshtml file which houses the data grid and a form to create new row in the data grid. In this scenario, the data in the grid refreshes correctly. But when the change happens on a another cshtml file, I am not able to carry these changes across to the other views. Can this be done in knockout and if yes, please point me to an example of how and where this has been done.
I would use a Event aggregator pattern. I have made one for SignalR
https://github.com/AndersMalmgren/SignalR.EventAggregatorProxy
Install usign nuget
Install-Package SignalR.EventAggregatorProxy
If you have no use for SignalR you can then extract the relevant parts from my lib, demo here
http://jsfiddle.net/jh8JV/
I am just starting out with mobile development and the data handling for Flex mobile applications seem to be plain horror. I have spent two days on it, tried about 10 different approaches and still can't find a clen working solution.
So i have a TabbedViewNavigatorApplication with many views and subviews. All of them should be able to access the same data that i want to store in a model (so basically they need to access the same model class to add, edit and retrieve some data from there).
I create one instance of a model, pass it as data to all view stacks
If i change something in one view stack and switch to another one, i see the changes and all is fine.
But if I change the model data in one view and restart the application, I see changed data in that view but if i switch to another view, it has the old (unmodified) model. I would assume that the model would be the same instance but apparently each view has its own "model" when saving persistance data.
So how do you manage shared model over all views ? Ideally i would create it once on the first app launch, and then just add / remove items from any view or subview.
Or do i need to use the SQLite for that ? In this case it seems i would need to fetch the data for each view each time a view changes to stay up-to-date with the current data in the database ?
Please help :)