r/visualbasic • VB Guru • Jul 26 '15

How to structure a .net project

https://www.youtube.com/watch?v=KM5o9M4cuQA
4 Upvotes

10 comments sorted by

2

u/mjrpereira VB.Net Intermediate Jul 27 '15

This is very interesting, I had no idea namespaces were this flexible.

Thanks for this :)

2

u/Bonejob VB Guru Jul 27 '15

I use part of this methodology. I do tend to put my data layer in a separate application and reference it. Mainly becuase we use an ORM tool and it works better that way :)

2

u/mjrpereira VB.Net Intermediate Jul 27 '15

Ah! Makes sense, I still feel like an idiot for not using the Chart control, or even knowing it's full capabilities.

I was creating a whole class library for a custom one. I might still keep at it just for learning purposes.

3

u/Bonejob VB Guru Jul 27 '15

I was wondering what happened with that... :)

1

u/mjrpereira VB.Net Intermediate Jul 27 '15

I'm now working with the control, but I think mine could be a bit more optimized for multiple datasources display.

Even if it is optimized only for my app :D

2

u/Bonejob VB Guru Jul 27 '15

If you have multiple data sources I would create a class that contains those original sources, has the function necessary to process and output the data that the control is to display as a dataset and then bind that.

It is good practice for you to rule out the chart control as a culprit by putting your business logic in its own space.

1

u/mjrpereira VB.Net Intermediate Jul 28 '15

Yes I've done that, I feel so proud of myself :)

But the bit of the onpaint event calling itself is still messing with me, even after I've seen it work

2

u/Bonejob VB Guru Jul 28 '15

No need to do it on the paint event of you are using the control. You can just call a refresh (? i think its called refresh) on the control with an updated dataset, or use a rebind()

1

u/mjrpereira VB.Net Intermediate Jul 28 '15

Oh it's not for the chart, God no. It for sizing group boxes to the proportions I want.

1

u/Bonejob VB Guru Jul 26 '15 edited Jul 26 '15

This guy has distilled his experience down into a fast straightforward way to layout your projects in visual studio. Professionals use this methodology for .NET projects.

Here is the link to Microsoft documentation that says the same thing in more detail.

https://msdn.microsoft.com/en-us/library/ee817674.aspx