User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 426,505 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,242 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums

GUI and Implementation Separation

Join Date: Apr 2008
Posts: 9
Reputation: macu is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
macu macu is offline Offline
Newbie Poster

Re: GUI and Implementation Separation

  #2  
May 15th, 2008
There's a few ways you could approach this issue. One option would be to have a lightweight album class that has e.g. a thumbnail of the album cover, an artist and title and a track count. You then create a collection of these and display them to the user in your UI. When the user wants to load a specific album, only then do you load an actual Album object with all track names, lengths, the full sized album cover, etc. It's not really a good idea to load all albums fully when the user may only browse a few and then close the app.

Another option is to keep what you have but use "lazy loading", basically you would have an album class that when loaded only loads, thumbnail, artist, title, track count. When the user then wants to view the album properly you load everything else. This can be done via property get's (i.e. if the app accesses the full album cover and it's not loaded, then you load it). Or you could have a method which does everything in one hit, e.g. Album.Open or something which would load album cover, all tracks, etc, etc.

The approach you take is partly dependant on how you feel about having multiple views (classes) of the same entity within your system. The first approach means having e.g. AlbumLite and Album classes which some people don't like. However, all of the important code is in Album as AlbumLite would just be a read-only view of the data.

HTH
Reply With Quote  
All times are GMT -4. The time now is 5:38 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC