reuse

What considerations should be made before reinventing the wheel?

All too often I see other people reinventing the wheel, and when I do, I wonder what factors played into their decision to do so. There are times I reinvent the wheel consciously, merely because I am interested in the mental exercise, and other times without realizing it because of a lack of research. What are considerations you use b...

Reuse MVC arhitecture; Have two layers of UI : ASP.NET MVC and .NET Winforms

Although my question might seem abstract I hope it's not. Suppose I develop an application, an ASP.NET MVC site and later I am tasked to build an Winforms client for this application how much and how can I reuse from the existing application? I defined the models, I defined controllers and views. They all work well. Now the boss comes ...

Do you buy the reuse story for the presentation layer in MVP and its variations?

Besides the unit testing benefits, what I heard regarding MVP pattern was that the reusability of the presentation layer. So, you would design one presentation layer and use it for WinForms (rich) and Web. I am currently working on a windows forms application in .NET with possibility of creating a web UI in the future. However, when I...

How can I make a user control's form portable to other pages

I have a user control that will be used in several pages (as is the custom with user controls) that contains a form. I was thinking on how to guarantee its functionality. First I wanted to have a single controller with a single method accept the values for this form. The only thing blocking me there is that after this method is done wit...

Server based reuse - DLL, GAC, or REST?

We have a piece of functionality that is used by several different applications (clients) on the same server. It can best be modeled as a service, has a backend database, and there will only be one version of the functionality and the database in use at any one time. Until now we have employed simple DLL-reuse, with the functionality, i...

Project source or published DLL's?

When reusing code (for example, a Util library you created), do you add its project to your solution or use a compiled/published DLL from the Util library? ...

Component reuse between ASP.NET and C#.NET

This might seem like a ridiculous question since I'm quite inexperienced in .NET. Is it possible to build components in C#, using .NET, which can be reused in ASP.NET. For example if one would like to port an application onto the web. If possible, how portable are they? I.e. can GUI be reused in some extent? Is there an intermediate fo...

Swing Reuse

I'm writing a Java Desktop App using NetBeans 6.5 and a Swing Patterns that keeps repeating. Each and every one of my dialogs has a "Save Button" and "Close Button" with different mostly different behaviour behind the Save Button and identical code behind the close button. How can I reuse this code without copying and pasting and at th...

Best way to reuse parts of an XML document?

Lets say I have an XML format similar to the following: <Random> <...Some arbitrary amount of nesting here...> <Random2> <Definition> <Name>Ape</Name> <Description>A mammal</Description> </Definition> </Random2> <Random2> <Definition> <Name>Ape</Name> <Description>A mammal...

Reusing Code from Another Rails App

I am trying to reuse some code from another rails application I had worked on earlier. I copied over all the models / views / controller / migrations and ran rake db:create and migrate. Now when I try to run the application the initial page for this view (the one that has the list edit/delete) loads fine and shows there are 0 records. Wh...

UITableViewCell Reuse Identifier with Variable Height Cells

I have five different cells in a table across five sections differing just in height, and text. Will I need to have one reuse identifier or five ? I am using a custom cell. The Apple document talks about reuse with cell having the "same general" configuration. Does differing height make each different for caching and reuse perspectives....

Reusable knowledge going from Embedded to Desktop

I'm thinking about switching my path "slightly" by going into desktop development (VC++, MFC, C#, etc) after about 8 years within embedded telecom systems development (C, MAKE, Symbian, 100 compilers etc, etc). My concern however is that my experience within embedded systems maybe doesn't give me much value when going into desktop devel...

Reusing a JPanel in NetBeans GUI Designer

This is in NetBeans 6.5, Java 6. I have the following hierarchy in the NetBeans GUI Designer: JFrame JTabbedPane JPanel X <...> JPanel JButton JPanel Y <...> JButton Question: JPanel Y is identical to JPanel X, so I'd like to simply reuse JPanel X in both places, but how do I do this inside ...

Reusing Ruby code across several Rails applications

I have developed a simple library in Ruby and need to use this in several Rails applications (some of which are not built yet). What is the best way to easily add this Ruby library to several Rails applications as and when required? Our team is running Ubuntu and our repository is Mercurial. Should I use a... Rails plugin? This would ...

[Beginner] JQuery reusable functions

Completely new to JQuery so I am learning everyday. One thing I noticed is how easy it is, you can just write $('div#test).remove(); But I am looking for an example on how to reuse some code, eg.: function RemoveTableRow(row, id) { $(row).remove(); // id should be used for ajax call } And then add a 'onclick' on my anchor-...

Can I re-use a Silverlight app in different areas of my page?

I've got a single Silverlight app that I'd like to display in a grid. The way the Silverlight app displays its content is dependent on the unique ID of the record in each grid row. Unfortunately, the XAP file is re-downloaded for each row in the grid. With a size of 700KB, this really impacts performance. Is it possible to download the X...

XML Reuse Question

In XML, is it possible to reuse elements? Specifically, the problem that I am trying to solve is the following. I want to define an element table that contains an element tableSchema and an element dataSource. I want to do this in a way that a tables can refer to a tableSchema defined elsewhere. Thusly, I can have multiple reports defin...

How do you organise your code library?

I am interested to know how people organise their code libraries, particularly with respect to reusable components. I am talking in OO terms below but I am interested in how your organise libraries for other types of language also. For example: Are you a stickler for class library projects for everything or do you prefer to keep every...

C++ : Code reuse, classes and libraries

Hello. Although I consider myself an experienced programmer (lead programmer of 2 commercially released games), I feel lost now that I have started using C++ for my next project. Right now I want to create a class to read/encrypt/decrypt JSON-like text-based data files (a custom format I have designed for my needs). Let's say it's calle...

Android: How to use existing graphic elements

Hi, I would like to create a user interface which would contain network indication icons (3G, WiFi...) and I would like to use existing graphic elements which are displayed in notification bar. Does anyone know how to get these existing elements and use it in custom layout? I guess these icons are all ImageView elements and I am wonde...