|I have a WPF app that is part of a basic n-tier design. UI <=> BL <=> DAL. It's been under construction for a while and we just keep adding features to it.
At some point in the future, 6 months or so, the BL and DAL will be hosted in a Web API in IIS on the client's server.
Right now, parts of the UI are VERY slow. There is a Project view with a detail section on top and sub tabs below. All of the data is being brought back as soon as the project is opened, and it takes a long time.
I want to do some refactoring, such as:
These are the top 3 issues. The big one is the load/save time.
- Lazy load the sub tabs. However, some tabs cannot be loaded unless data from other tabs is there. Other tabs are stand-alone.
- Everything is synchronous. Make back end calls async.
- If a tab's data is changed, for the most part the other tabs don't know about it. A few raise a changed event, but for the most part, the Project needs to be reloaded. Changes from other users are not reflected at all until the Project is reloaded. So I could keey the local data synchronized, but for data from other users, provide change notification somehow.
For the Project opening load time and save time issue, one idea I've had is to create a 'package', which would just be a class with only the data that is needed to load the Project, and asynchronously call that when the tab is opened. Then, lazy load tabs as needed. They also would use the package concept to get only the data needed to populate that tab, which could be one or more lists of entities.
On save, load & send the Package class with only the data that has changed back to the DAL.
I'd like to hear what you guys think.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.