1

I have a 3D animation that I Would like to output to different file formats such as .BVH, .FBX...

What is the design pattern that is suitable for implementing this kind of functionality ?

Would the factory design pattern work ? Why and why not.

Thanks

1

4 Answers 4

3

I think what is important is the design instead of the pattern name. I think what you need is a kind of adapter:

public interface IAnimationFormat {
    void Save(Animation animation);
}

public class Bvh : IAnimationFormat {
    public void Save(Animation animation){
        ...
    }
}

public class Fbx : IAnimationFormat {
    public void Save(Animation animation){
        ...
    }
}

You could also add Load methods and stuff.

Sign up to request clarification or add additional context in comments.

Comments

3

It's not either Builder or Factory. It looks like the Strategy pattern.

1 Comment

Strategy Pattern looks like the most suitable solution for this kind of problem. An example here: dzone.com/articles/design-patterns-strategy
2

You should consider Builder & Factory pattern for this context.

Comments

0

I would use the observer pattern. Say you have observable class A and observers Class C and D. Click SAVE on A, raise and event to inform B, C, ....any more observers to perform the SAVE action.

http://www.dofactory.com/Patterns/PatternObserver.aspx

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.