Your Own Framework
-
I just read [an article here](https://www.codeproject.com/Articles/1165750/Message-Sinks) on CP where the author says "For many years I've been building a library themed "things that should be built into the .NET framework, but aren’t"." I too have been compiling things I use regularly into my own framework. Everything from logging, registry stuff, app security, WPF things, Data related stuff, ZIP, messaging, etc.). In my WPF library I even subclassed the standad WPF controls and then in my WPF apps I use my version of the controls. For the most part, when I find myself using code repeatedly I start thinking about where in my framework to put it so that I can re-use it again later. So I'm curious... Do you do this? Create a library/framework of reusable code? If you, how do you put it all together? If not, how do you handle using/reusing common code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
Yes. I have a couple of libraries (being primary a SharePoint Developer), I’ve got a Common, Winforms, ASP.NET and SharePoint libraries (including unit tests) which I’ve built up over the years of consulting.
-
I just read [an article here](https://www.codeproject.com/Articles/1165750/Message-Sinks) on CP where the author says "For many years I've been building a library themed "things that should be built into the .NET framework, but aren’t"." I too have been compiling things I use regularly into my own framework. Everything from logging, registry stuff, app security, WPF things, Data related stuff, ZIP, messaging, etc.). In my WPF library I even subclassed the standad WPF controls and then in my WPF apps I use my version of the controls. For the most part, when I find myself using code repeatedly I start thinking about where in my framework to put it so that I can re-use it again later. So I'm curious... Do you do this? Create a library/framework of reusable code? If you, how do you put it all together? If not, how do you handle using/reusing common code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
Anything that can be generalized is added to the library. Some of it even ends up as articles. But the backlog seems to be growing, mundane things such as family, work and procrastination, tends to get in the way.
Wrong is evil and must be defeated. - Jeff Ello
-
I just read [an article here](https://www.codeproject.com/Articles/1165750/Message-Sinks) on CP where the author says "For many years I've been building a library themed "things that should be built into the .NET framework, but aren’t"." I too have been compiling things I use regularly into my own framework. Everything from logging, registry stuff, app security, WPF things, Data related stuff, ZIP, messaging, etc.). In my WPF library I even subclassed the standad WPF controls and then in my WPF apps I use my version of the controls. For the most part, when I find myself using code repeatedly I start thinking about where in my framework to put it so that I can re-use it again later. So I'm curious... Do you do this? Create a library/framework of reusable code? If you, how do you put it all together? If not, how do you handle using/reusing common code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
I'm doing it even for a higher level stuff like search dialogs, connectivity, data handling etc. I'm lazy as fuck, so I reuse every single bit of code.
There is only one Vera Farmiga and Salma Hayek is her prophet! Advertise here – minimum three posts per day are guaranteed.
-
[Harold doesn't](https://www.codeproject.com/Messages/5349548/Re-Your-Own-Framework.aspx)... I think that any serious developer would understand the need for their own collection of code. For the last 15 year I've been doing .Net. Before that I was a FoxPro developer. I has a very large collection of resuable code that I later developed into a framework that i tried to market as FramePro. Never caught on as a selling point but I used it in many apps.
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
Kevin Marois wrote:
I later developed into a framework that i tried to market as FramePro
The one thing I have resisted is trying to "market" my framework. I do leave it behind at every contract I have worked on. I know of at least 5 developers who have adopted it (ie snaffled the code from previous contracts) but I have never been tempted to publicise it. I agree that most serious developers create a suite of tools/snippets and concepts that become part of their infrastructure, but to me it is a very personal thing suited to the way a developer works and it's transferablility is quite limited.
Never underestimate the power of human stupidity RAH
-
I just read [an article here](https://www.codeproject.com/Articles/1165750/Message-Sinks) on CP where the author says "For many years I've been building a library themed "things that should be built into the .NET framework, but aren’t"." I too have been compiling things I use regularly into my own framework. Everything from logging, registry stuff, app security, WPF things, Data related stuff, ZIP, messaging, etc.). In my WPF library I even subclassed the standad WPF controls and then in my WPF apps I use my version of the controls. For the most part, when I find myself using code repeatedly I start thinking about where in my framework to put it so that I can re-use it again later. So I'm curious... Do you do this? Create a library/framework of reusable code? If you, how do you put it all together? If not, how do you handle using/reusing common code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
I do, and as soon as i figure out it needs to be enlarged or split i do so to keep it on point. Though it's not always easy since all dependend projects could be affected with the change.
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
} -
I just read [an article here](https://www.codeproject.com/Articles/1165750/Message-Sinks) on CP where the author says "For many years I've been building a library themed "things that should be built into the .NET framework, but aren’t"." I too have been compiling things I use regularly into my own framework. Everything from logging, registry stuff, app security, WPF things, Data related stuff, ZIP, messaging, etc.). In my WPF library I even subclassed the standad WPF controls and then in my WPF apps I use my version of the controls. For the most part, when I find myself using code repeatedly I start thinking about where in my framework to put it so that I can re-use it again later. So I'm curious... Do you do this? Create a library/framework of reusable code? If you, how do you put it all together? If not, how do you handle using/reusing common code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
I have a tiny one for automating view and viewmodel comms, and lots of share code in base classes in my framework. So far I still just Copy-Paste the first steps from the previous project. It is a framework, but only within each new project and not yet ready as a proper stand-alone framework.
Follow my adventures with .NET Core at my new blog, Erisia Information Services.
-
Same here. No external library, just code snippets.
-
I just read [an article here](https://www.codeproject.com/Articles/1165750/Message-Sinks) on CP where the author says "For many years I've been building a library themed "things that should be built into the .NET framework, but aren’t"." I too have been compiling things I use regularly into my own framework. Everything from logging, registry stuff, app security, WPF things, Data related stuff, ZIP, messaging, etc.). In my WPF library I even subclassed the standad WPF controls and then in my WPF apps I use my version of the controls. For the most part, when I find myself using code repeatedly I start thinking about where in my framework to put it so that I can re-use it again later. So I'm curious... Do you do this? Create a library/framework of reusable code? If you, how do you put it all together? If not, how do you handle using/reusing common code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
Any technical (vs. business) code should always be a library. (Others touch on this as well) In addition, create a Façade (at the minimum) for any System or Third Party library that is not part of the deep core of the language or that is heavily used in the business layer. This protects business logic from platform upgrades or Third Party changes. A good example is email.
-
I think just about everyone does, don't they? I've got personal libraries for every language I've ever worked in.
I wanna be a eunuchs developer! Pass me a bread knife!
Mark_Wallace wrote:
I've got personal libraries for every language I've ever worked in.
Same here. I still have the 20+ classes I wrote for VB4-6, mostly ones that wrapped the Windows API (not that they're of any current value). OTOH, my current Word normal.dotm file has macros that were written in the Word 95 days; they still work just fine. I appreciate Harold's POV in that a lot of what I write is not situated for re-use, although the ideas behind it are. However, I find I do write a lot of things that are re-usable: encapsulating export of grids to Excel (including formatting the resulting workbook), extensions to the treeview and listview, encapsulating Windows file searches, and encapsulating database functions. Accessing WinAPI functions from VB was a PITA and it made sense to encapsulate the functions so they were easy to use. This "encapsulate hard to use functions" mindset of my VB days bleeds forward -- I look for things I'll probably re-use and automatically think about creating a re-usable class.
-
Oh yes. When I write code, I write it with an eye to "generalization" so that it can be moved into a library - and I have have several just for C#, each containing different but related material - once it's shown to work and can be properly tested. If you don't keep libraries of "good code" then you will be re-inventing the wheel far, far, too much.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
xkcd :)
-
I just read [an article here](https://www.codeproject.com/Articles/1165750/Message-Sinks) on CP where the author says "For many years I've been building a library themed "things that should be built into the .NET framework, but aren’t"." I too have been compiling things I use regularly into my own framework. Everything from logging, registry stuff, app security, WPF things, Data related stuff, ZIP, messaging, etc.). In my WPF library I even subclassed the standad WPF controls and then in my WPF apps I use my version of the controls. For the most part, when I find myself using code repeatedly I start thinking about where in my framework to put it so that I can re-use it again later. So I'm curious... Do you do this? Create a library/framework of reusable code? If you, how do you put it all together? If not, how do you handle using/reusing common code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
I think it is natural to develop a "code library" of sorts for the things that should be easier, but are not, or the things like Logging which need different implementations depending on the type of application, etc. Sometimes, just wrapping an outside tool so we all use it in a consistent manner. Logging, and Timing come to mind. We add those to every project. Then we have impersonation things we do all the time in web frameworks so we can test specific user features/paths. It all feels like a framework at some point, because we know it is going to be in there, but it is really a set of libraries and approaches, so we are not locked in too far.
-
I just read [an article here](https://www.codeproject.com/Articles/1165750/Message-Sinks) on CP where the author says "For many years I've been building a library themed "things that should be built into the .NET framework, but aren’t"." I too have been compiling things I use regularly into my own framework. Everything from logging, registry stuff, app security, WPF things, Data related stuff, ZIP, messaging, etc.). In my WPF library I even subclassed the standad WPF controls and then in my WPF apps I use my version of the controls. For the most part, when I find myself using code repeatedly I start thinking about where in my framework to put it so that I can re-use it again later. So I'm curious... Do you do this? Create a library/framework of reusable code? If you, how do you put it all together? If not, how do you handle using/reusing common code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
I built a framework for an ERP system once. The only "framework" I have these days includes: 1) A class for serializing / deserializing any object to / from xml 2) A class for sending emails.
"(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal
-
I just read [an article here](https://www.codeproject.com/Articles/1165750/Message-Sinks) on CP where the author says "For many years I've been building a library themed "things that should be built into the .NET framework, but aren’t"." I too have been compiling things I use regularly into my own framework. Everything from logging, registry stuff, app security, WPF things, Data related stuff, ZIP, messaging, etc.). In my WPF library I even subclassed the standad WPF controls and then in my WPF apps I use my version of the controls. For the most part, when I find myself using code repeatedly I start thinking about where in my framework to put it so that I can re-use it again later. So I'm curious... Do you do this? Create a library/framework of reusable code? If you, how do you put it all together? If not, how do you handle using/reusing common code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
For those of us that do keep a reusable framework around, how do we like to organize it? - Create a personal NuGet package? - Keep a Visual Studio project around that gets included into each project that uses it? - Keep a folder full of *.cs files that get copied into a project when needed? - Keep a *.dll (or folder of them) to reference without looking at the source code?
-
For those of us that do keep a reusable framework around, how do we like to organize it? - Create a personal NuGet package? - Keep a Visual Studio project around that gets included into each project that uses it? - Keep a folder full of *.cs files that get copied into a project when needed? - Keep a *.dll (or folder of them) to reference without looking at the source code?
What works for me is to organize things into projects, then include the project in the apps I'm working on. The issue with this is versioning. I probably need to create a defined version of each project, then create a NuGet repository that I can publish from.
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.