So now I have Lists that contain lists, and I was wondering if this was a mistake. How would a more experienced programmer have done things? This works, but what sort of problems am I setting myself up for?
How would you have done it?
I am at the end of a project, and I don't have much experience, and was just wondering if the way I did things were sensible, or if there were better ways. For example, part of the program tracks orders. I made an order class, with several List type properties or classes such as pizza, sub, side, drink, etc. the pizza class has several List properties as well, for single toppings, double toppings, halves, etc. Upon completion, orders are serialized and stores in a database.
So now I have Lists that contain lists, and I was wondering if this was a mistake. How would a more experienced programmer have done things? This works, but what sort of problems am I setting myself up for?
So now I have Lists that contain lists, and I was wondering if this was a mistake. How would a more experienced programmer have done things? This works, but what sort of problems am I setting myself up for?
Roei BarPosted Sep 17, 2009, 6:28 PM
Sub and Pizza both have a Price Tag...
about the idea of List inside a List well there is no option to do this in your case since an Order can include Pizza and Sub
and Pizza topping types are another List inside the Pizza Object
and so on.
complex is the big news in dev today ;-)
patrickPosted Sep 18, 2009, 10:27 AM
patrickPosted Sep 17, 2009, 5:32 PM
Roei BarPosted Sep 17, 2009, 2:56 PM
i would recommend you to build an abstract class called Product, all Products sold will inherit from it, then you will be able to hold a List of Products
and in order to add new Product you wont need to make sure they have the basics only the different Properties.
this will make your code much more organized, and make the ability to add new Products or Update the Basics or a specific Product will be easier.
Kirtan PatelPosted Sep 17, 2009, 2:51 PM
We can build DLL no matter how much the messy code :)
but if you having small software its ok that you use class wise development but
if software is some what big Better to build DLL's for each Module of Software so that in future we can manage it properly :)
patrickPosted Sep 17, 2009, 2:11 PM
Kirtan PatelPosted Sep 17, 2009, 2:02 PM
I will build a DLL From all the Class so that i can change my code as per requirement in future and i don't have to Recompile Whole Solution to Provide it to User of The application I just have to recompile the Dll File that Contain code :)
and also it will be helpful if i wanted to build Command Line Interface application from those DLL Files :)
dont forget to mark "Do you like answer" please it will give me some credits :)