For a newsroom system I have a class that contains a single news story. Inside this class is a private variable holding a generic List of image classes. The idea being a single story can contain multiple images.
The question is should I make the List variable public, so that I can add/remove images by addressing the List directly
public class News
{
private _images List<Images>();
public Images
{
get { return _images; }
set { _images = value }
}
}
or
Should I make the List variable private and then create methods to manipulate it:
public class News
{
private _images List<Images>();
public void AddImage( Image image )
public Image GetImage( int imageId )
public int GetImageCount()
public void DeleteImage( int imageId )
}
My spider sense is telling me to do the later, as it's abstracting things more. But on the flip side its creating more code.