code-reuse

What should I propose for a reusable code library organization?

My organization has begun slowly repurposing itself to a less product-oriented business model and more contract-oriented business model over the last year or two. During the past year, I was shifted into the new contracting business to help put out fires and fill orders. While the year as a whole was profitable (and therefore, by at le...

How do people get mixin-style re-use in C#?

I come from a C++ background where I can use template mixins to write code that refers to FinalClass which is a template parameter that is passed in. This allows reusable functions to be "mixed-in" to any derived class, by simply inheriting from ReusableMixin with a template paramter of MyFinalClass. This all gets inlined into the clas...

What is the best way to reuse functions in Flex MVC environment?

I am using a Cairngorm MVC architecture for my current project. I have several commands which use the same type of function that returns a value. I would like to have this function in one place, and reuse it, rather than duplicate the code in each command. What is the best way to do this? ...

How do classes help you manage large applications?

This came up in a conversation I was having online, and it occured to me that I have no idea how this is supposed to work: Quite a lot of programmers seem to just take as a given- indeed, obvious that classes are a necessary language feature for managing huge software projects. It's not obvious to me how they do this. My question to yo...

What reusable code should every developer have in their toolbox?

I'm trying to build up a library of reusable code to use from project to project. As I write code snippets and components, I'm trying to decide which libraries I will get the most use out of long term VS will I really use this again? What code or components do you reuse that should every developer have? I'm primarily interested in .net...

Applying Existing Tablestyle to a Gridview

I'm working on a web-enabled version of our existing winforms project. Gridviews seem to be an ample replacement for the datagrids that we've been using. We have extensive table styles written for the old datagrids. Is it possible to reuse this code to apply a style to a gridview? If a re-write is necessary, what is the best way to s...

What's better? Sharing Code at the source or binary level.

I've worked on a variety of projects and there seems to be some debate as to what is better. I prefer to only share code on internal projects at the binary level (assemblies in .NET, for example). But I've worked with plenty of people that would rather share code at the source code level. I say that adds too much risk of a breaking ch...

Coding Priorities: Performance, Maintainability, Reusability?

This came about mainly due to answers to SQL questions. UDF's and Sub Queries are intentionally omitted because of performance. I didn't include reliability not that it should be taken for granted, but the code has to work. Does performance always come first? So many answers are provided with performance as the main priority. My users s...

How do you foster the use of shared components in your organization?

If your company or project places an emphasis on (or at least appreciates) the development of code and components that can be reused and shared across projects, what are the "social engineering" things you've needed to do to facilitate the re-use the code? In my experience, code or components that are simply stated as being "reusable" w...

How do you reuse html/js/server side code between asp.net projects?

We have a blog system that we sold to a number of different customers (included in many different projects). This system includes a number of different files – a few aspx pages, one or two ascx controls, one css file, one javascript file and some codebehind/vb.net utility files. In general 90+% of this module is the same between custom...

ASP.NET MVC UserControl requires css/javascript

I have a user control (a user details form) which has a lot of javascript and css attached to it. i'm struggling to make my control decalre that it needs a certain file so it will be included in the "head" section of the html. I also wonder what happens if i enter mutiple instances of a control (the is no InamingContainer or anything si...

UC(User component) concept in Win32/.NET Win forms.

Couple of year ago I when to work for company as web developer. It has my first Sirius web development job, (ASPx/C#) so it has very exciting and I learned a lot about that world, from the developer point of view. In that group we had a concept for the pages where loaded in the page UC’s (User controls), I don’t know if it’s the same in...

Tools to identify code duplications

I have being reading and tracking some questions on code reuse and I have this question: Are there any tools to identify duplicate or similar code? I have googled this a while ago and found nothing good. ...

Combining recursive iterator results: children with parents

I'm trying to iterate over a directory which contains loads of PHP files, and detect what classes are defined in each file. Consider the following: $php_files_and_content = new PhpFileAndContentIterator($dir); foreach($php_files_and_content as $filepath => $sourceCode) { // echo $filepath, $sourceCode } The above $php_files_and_c...

Inheritance in Silverlight 2 Styles

I want to build up styles in XAML, e.g. <UserControl.Resources> <Style x:Key="MyStyle" TargetType="TextBlock"> <Setter Property="Margin" Value="2,2,2,2" /> <Setter Property="Foreground" Value="DarkRed" /> </Style> <Style x:Key="MyBoldStyle" TargetType="TextBlock"> <Setter Property="Style" Value="{Stat...

Best approach to separate and re-factor a large number of dependent classes

I have a v-large number of hierarchical structures (or DTO's) that are shared across different business logic, application tiers, web service and WCF contracts. I want to refactor all of my code to split the structures into discreet business domain areas. Two questions: Are there any tools that can help me do this (given that I want c...

Good Idea / Bad Idea Should I Reimplement Most Of C++?

Recently, I've got a dangerous idea into my head after reading this blog post. That idea can be expressed like this: I don't need most of what the C++ standard library offers. So, why don't I implement a less general, but easier to use version? As an example, using the STL spits out reams of incomprehensible and mangled compiler errors...

Reorganizing a project for expansion/reuse

The scope of the project I'm working on is being expanded. The application is fairly simple but currently targets a very specific niche. For the immediate future I've been asked to fork the project to target a new market and continue developing the two projects in tandem. Both projects will be functionally similar so there is a very str...

Are there any problems if you essentially copy another solutions code structure?

Emphasis on structure: Code layout/interfaces Physical file layout etc. Naming of files and classes etc. My understanding is that if the implementation is completly different then your ok to use the layout as that can't really be 'copyrighted'? For example if a solution has X, Y, Z projects with classes arranged in certain fol...

What place for server controls in ASP.Net MVC?

Hello. What is the recommended replacement of ASP.Net server controls in the bright new world of ASP.Net MVC? In my opinion, one of the best features of ASP.Net is the ability to write server controls (although, admittedly, the event model is horrendous to deal with). If these controls are self-populating, then they can be shared betwee...