jeudi 2 février 2017

Design Pattern - Is this a correct way to use Decorator?

I've used Decorator to create a Dataset class used to build a Dataset Basic Empty (ConcreteComponent) and Iris class (ConcreteDecorated) used to populate it:

Decorator allows a user to add new functionality to an existing object without altering its structure

For Example Iris has a its own way to load and store the data in dataset structure. In iris, I've added also the name features to track the string name of there features.

My purpose is to add more ConcreteDecorator, like Iris, that they have a own way to load and store file and to track the name features. Can you look this simple test in java and advise me if it's good?

Aucun commentaire:

Enregistrer un commentaire