oehm-smith / StockFx

JavaFx implementation of my very own (: ) portfolio management tool. Creating as enjoying JavaFx and want to play with it a bit more and I have a few stock portfolio ideas I'd like to play with.
1 stars 1 forks source link

Change to using Set types for Portfolios in Stocks and VV #3

Closed oehm-smith closed 11 years ago

oehm-smith commented 11 years ago

I'd originally started doing this but ran into problems and because I was dealing with getting the Many 2 Many relationship working I just used Lists which are simpler.

However I'd like to change to using Sets to enforce at the db level that Portfolios can only have one of each stock and VV.

oehm-smith commented 11 years ago

I tried to get this working and it just turned out unrealistic. Tables and Combos can't show ObservableSets, only ObservableLists, so to make this happen I had to create a bridging ObservableLists but then that loses the connection to the observability and the ui isn't being updated. Its leading to ugly solution and only to enforce at the DB level that can't have duplicate stocks in portfolios. I'm going to revert any changes i had (I created a StockFx_2013-03-07.tgz at the root of the repo but won't commit this). And instead just put a test when I go to add to the ObservableList. Less time efficient but won't be much and prevents uglier code being introduced.