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 BarRank #1,271 · 1.4K reputationPosted Sep 17, 2009, 2:28 PM EDT
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 ;-)
Kirtan PatelRank #292 · 8.6K reputationPosted Sep 17, 2009, 10:02 AM EDT
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 :)
patrickRank #4,458 · 342 reputationPosted Sep 17, 2009, 10:11 AM EDT
Kirtan PatelRank #292 · 8.6K reputationPosted Sep 17, 2009, 10:51 AM EDT
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 :)
Roei BarRank #1,271 · 1.4K reputationPosted Sep 17, 2009, 10:56 AM EDT
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.
patrickRank #4,458 · 342 reputationPosted Sep 17, 2009, 1:32 PM EDT
patrickRank #4,458 · 342 reputationPosted Sep 18, 2009, 6:27 AM EDT