 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Graeme Geldenhuys Guest
|
Posted: Wed Jun 07, 2006 2:26 pm Post subject: Is this to much functionality in a class |
|
|
Hi,
I develop software for a maths tutoring company. Currently we have a
TModule object which holds information about a specific lesson. A
lesson consists out of Macromedia Flash files called slides which are
wrapped in TSlide objects and contains a bunch of other details.
When a lesson is started, a TPlayList object gets passed a TModule
object in a LoadPlayList method. The TPlayList then orders the TSlide
objects in the correct playing order. The TPlayList also handles the
MoveBack, MoveForward, Menu, etc functionality. Our product has two
user interfaces. One a normal GUI app and the other a Web app.
Now the actual flash files (*.swf) are encrypted. So before they can be
played, they are decrypted using a TDCPCrypt component. Currently the
TPlayList contains a private instance of the TDCPCrypt component. This
is the part that I don't like! There is a hard link between the
TPlayList object and the TDCPCrypt component.
Is that to much functionality in the TPlayList. Is there another way, I
can move the decryption out of the TPlayList object?
Regards,
Graeme. |
|
| Back to top |
|
 |
Joanna Carter [TeamB] Guest
|
Posted: Wed Jun 07, 2006 3:15 pm Post subject: Re: Is this to much functionality in a class |
|
|
"Graeme Geldenhuys" <graemeg (AT) spamfilter (DOT) co.za> a écrit dans le message de
news: 44869bc5 (AT) newsgroups (DOT) borland.com...
| Is that to much functionality in the TPlayList. Is there another way, I
| can move the decryption out of the TPlayList object?
IMO, that functionality belongs in the TSlide class, possibly a small
hierarchy based on an abstract class or interface ?.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer |
|
| Back to top |
|
 |
Graeme Geldenhuys Guest
|
Posted: Fri Jun 09, 2006 3:57 pm Post subject: Re: Is this to much functionality in a class |
|
|
Joanna Carter [TeamB] wrote:
| Quote: | | Is that to much functionality in the TPlayList. Is there another way, I
| can move the decryption out of the TPlayList object?
IMO, that functionality belongs in the TSlide class, possibly a small
hierarchy based on an abstract class or interface ?.
|
Indeed, that does make a lot more sense. While I was at it, I
implemented the Strategy pattern as well, to remove the hard-link
between the class and the encryption component. Now we can swap out
encryption algorithms without problems.
Thanks for your input.
Regards,
- Graeme - |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|