3

Let explain what I'm trying to create. I'm creating a framework, the idea is to provide base classes to generate a math problem.

Why do I need this framework? Because at first time, I realized when I create a new math problem I always do the same steps.

  • Configuration settings such range numbers. For example if I'm developing multiplications, in beginner level only generate the first number between 2-5 or in advanced level, the first number will be between 6- 9, for example.
  • Generate problem method. All the time I need to invoke a method like this to generate the problem. This one receives the configuration settings and generate the number according to them. And generate the object with the respective data.
  • Validate the problem. Sometimes the problem generated is not valid. For example, supposed I'm creating fractions in most simplified, if I receive 2/4, the program should detect that this is not valid and must generate another like this one, 1/4.
  • Load the view. All of them, have a custom view (please watch below the images).
  • All of the problems must know how to CHECK if the user result is correct.
  • All of this problems has answers. Some of them just require one answer, anothers may require more than one, so I guess a way to maintain flexibility to the developer has all the answers he wanna used.
  • At the beginning I started using PRISM. Generate modules for each math problem was the idea and load it in the main system.

I guess are the most important things of this idea.

Let me showing some problems which I create in a WPF standalone program. Here I have a math problem about areas. When I generate the problem a set to the view the object and it draw it.

enter image description here enter image description here

In beginner level, I set in the configuration settings that just load square types. But in advance level, can load triangles and squares randomly.

In this another, generate a binary problem like addition, subtraction, multiplication or division.

enter image description here enter image description here

Above just generate a single problem. The idea of this is to show a test o quiz, I mean get a worksheet (this I call as a collection of problems) where the user can answer it.

enter image description here

I hope gets the idea with my ugly drawing.

How to load this math problems? As I said above, I started using PRISM, and each module contains a math problem kind. This is a snapshot of my first demo.

enter image description here

Below show the modules loaded, and center the respective configurations or levels.

Until momment, I have no idea to start creating this software. I just know that I need a question | problem class, response class, user class.

But I get lost about what properties should have to contain in it.

Please give a little hand of this framework. I put much effort on this question, so if any isn't clear, let me know to clarify it.

1
  • let me sum up your question: You want to create a framework to generate, configure and validate math problems. By framework, do you mean APIs that can be used? The following would make your question more clear: 1. Drawings are not visible, can you check again? 2. Mention a sample math problem and go through all the steps for it. 3. Your point about PRISM does not fit with the rest of the steps. Consider changing that portion. Sep 13, 2012 at 8:20

2 Answers 2

3

You sound like someone who has minimal experience with software design. And for you I have one golden advice : DO NOT CREATE A FRAMEWORK! (all caps for emphasis).

If you try building abstractions now, you will most probably create wrong ones.

You want to create an application that creates math problems and groups them into work sheets. So do that. Start stacking ifs and variables into code-behind of views and see where it goes. And after that, you can start looking at common patterns in your code and extracting abstractions.

Also, be prepared to fail. I would be quite surprised if, on your first try, you created something that was actually like you imagine it. Be prepared to scrap what you have and start over, now with more experience and insight on how to build what you want.

2

Turn the problem into a group of smaller problems (Modules if you like) that each have a single responsibility. For example "Generate problem method" is too high level to think about implementing. (considering all the different types of problems you have talked about generating: Worksheets, Diagrams etc.) If you split it into smaller parts you can then focus on solving each of these parts. You can then split these problems further if need be.

It seems to me like it is slightly too early for you to be thinking about classes. A helpful step can be thinking about these different modules of the program and how you will test them, if you cannot think of how you would go about testing them then you don't have a clear picture of their intended purpose.

Also, you will need a strong architecture to be able to build this efficiently, you have a lot of shared components such as validating the problems and the graphical interface but the problems themselves can be very different. I'm currently reading Design Patterns: Elements of Reusable Object-Oriented Software and would recommend it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.