Skip to content
  • 0 Votes
    4 Posts
    876 Views
    Well it's a vague description of a problem but let me try to spill some thoughts that might help you. I know that when you start a new project it's tempting to just sit and start coding but take a while to (roughly) plan the thing first. First decide on one phrase that will define your app. Don't focus on individual functionalities. Just something like "a music player", "a database engine"or "a game" will do. Next, based on that, list the minimum necessary functionalities that match that description. Again - don't go into details e.g. what color it will havem what for loop you need to write in what class or where a particular button will be placed. That's not important yet. Things like "streaming music", "read/write xml file", "prompt user for credentials", "interpret gamepad input" etc. For these start to split them into functionalities that you can encapsulate into classes. A good rule of thumb is that a class name should describe the whole class functionality. If you need to use "and" to do that, e.g "XmlReaderAndParser" or "LoginDialogAndCredentialsValidator" , the class is too big and you should split it. Now you should have a fairly long list of classes. Go through them and see which are ui classes, which are app logic ones and which are helpers. Try to create a dependency diagram for them i.e. which class uses which. You should try to make as little connection lines as possible. You should try to have as close to 0 lines connecting ui classes with logic classes as possible. Now you can start coding. Again - a little against the first impulse - start with the utilities, not the big functionalities. Write proper tests and make sure the little blocks work. Building the classes up the hierarchy should seem like joining lego bricks. Writing test cases for them should also be trivial this way. My feeling is you focused on a detail and you can't see the forest for the trees. If you start the process this way, the decision whether to use a designer or not will become minor. Designer and code generation is a convenience feature and it does not (or should not) influence the general design of your app. It basically does the single "setupUi" method for you. If it can cut some coding time of yours - great, use it. If you need to spend more time because you decided to use it - just ditch it, no big deal.