File Upload

Posts   
 
    
Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 11-Oct-2005 18:07:02   

Hi,

I have an entity which has a field which stores the name of an image in the filing system.

When one of these entity instances is being created, the image needs to be saved to disk too.

Should I inherit from the entity and have the entity save the image file?

Or should my presentation layer be interacting with a 'manager class' which handles saving the file and doing the database work via the entity instance?

Cheers, I.

Paul.Lewis
User
Posts: 147
Joined: 22-Aug-2005
# Posted on: 12-Oct-2005 04:08:52   

Ian wrote:

Hi,

I have an entity which has a field which stores the name of an image in the filing system.

When one of these entity instances is being created, the image needs to be saved to disk too.

Should I inherit from the entity and have the entity save the image file?

Or should my presentation layer be interacting with a 'manager class' which handles saving the file and doing the database work via the entity instance?

Cheers, I.

Extending or inheriting the entity class is the cleaner solution. Both solutions are vaible.