Questions tagged [code-reuse]

The use of existing software, or software knowledge, to build new software

875 questions
0
votes
1 answer

Find out the Identity of the request sender - AJAX Auto Complete Extender

this is a typical webMethod i am using as a dataSource for Ajax autoComplete Extender [System.Web.Script.Services.ScriptMethod()] [System.Web.Services.WebMethod(EnableSession = true)] public static List FontNamesList_AutoCompDataSrc(string…
LoneXcoder
  • 2,121
  • 6
  • 38
  • 76
0
votes
0 answers

jQuery tabs navigation for multiple server generated elements

This is a great script that will work for several different instances of tabs on a page: jQuery('.tab_container').each(function(){ var select = jQuery(this); select.find('.detail').hide(); select.find('.detail:first').show();…
namretiolnave
  • 781
  • 1
  • 9
  • 25
0
votes
3 answers

How to reuse javas anonymous inner classes if they take different final parameters?

I need to create anonymous inner types that are expensive to build and need to acces a final variable in it. The problem is that I need to create many of them with the only difference that the used final variable is different (object itself and…
user1563700
0
votes
2 answers

Getting data to callback method

I have the following code and architecture (in fact this is a very simplified version) consting of a abstract and a concrete class. public abstract class AbstractProcessor { public void updateDataFromUrl(String url) { //Download url …
theomega
  • 31,591
  • 21
  • 89
  • 127
0
votes
2 answers

Can I create a controller in a common assembly which will be accessible by any assmbly which references it?

I have a common assembly where I put a lot of my helper functions etc. I want to create a common EmbeddedResourceController (kind of like WebResource.axd was for WebForms) which all my HTML helpers can use to embed and display their scripts and…
just.another.programmer
  • 8,579
  • 8
  • 51
  • 90
0
votes
1 answer

Global variables for setting configurations ASP.NET MVC

I wanted to define a global variable in ASP.NET MVC project which will have static configurations details. Like context name, project name etc. Actually I am working on developing reusable component for which you can set all these variables and…
Amit Raya
  • 11
  • 1
  • 5
0
votes
2 answers

C++: how to reuse code in covariant return types?

I have the following simple class class base { public: int x; base &set(int y) { x = y; return *this; } }; and want to create a new one with added functionality, say to print the value x. So I do: class derived : public…
linuxfever
  • 3,763
  • 2
  • 19
  • 43
0
votes
3 answers

Derive overloaded operator, but operate on same types only

Suppose I have a base class and two classes derived from it: class Base { protected: double value; public: virtual ~Base(); Base(double value) : value(value) {} Base(const Base& B) { value=B.value; } Base operator+ (const…
Rody Oldenhuis
  • 37,726
  • 7
  • 50
  • 96
0
votes
2 answers

A tool to document all reusable components in my company's projects

My company has developed several projects. With time, we have found that certain functionalities were implemented more than once in more than one project. Now we're aiming at extracting the common code into reusable components. However, we need a…
SaryAssad
  • 161
  • 1
  • 3
  • 20
0
votes
1 answer

SqlDataSource reuse on different pages

I am using ASP.NET. I have a ReportPage1 and ReportOutputPage1. These are different aspx files and has different MasterPages. However, I need the same SqlDataSource object to use on both pages. On ReportPage I need SqlDataSource to call…
renathy
  • 5,125
  • 20
  • 85
  • 149
0
votes
1 answer

Reusable Code in MVC3 C#.Net

I have an MVC3 C#.Net web app. I have two views that display the same HTML table. However, each View represents a different Model. View 1 = "ProposalEdit", View 2 = "DocEdit". Both the Proposal model and the Doc model have a property:…
MikeTWebb
  • 9,149
  • 25
  • 93
  • 132
0
votes
2 answers

How to reuse the same View for WPF and Silverlight?

Is it possible to use the same Views for Silverlight and WPF? I have ported a little MVVM Silverlight project to WPF. I could reuse all instead of App/MainWindow and the Views. How could I reuse the Views?
koalabruder
  • 2,794
  • 9
  • 33
  • 40
0
votes
3 answers

How can I reuse classes in my VB6 application?

First of all, as I am using VB6, please confine your kind suggestions to techniques applied to VB6. I have a set of controls related to each other as the above figure shows. It includes several treeviews, a split bar, a listview, a subform( a…
SlowGrace
  • 15
  • 1
  • 1
  • 7
0
votes
2 answers

Best way to create a basic reusable rails application

I find myself writing the same things over and over again when starting a new Rails application. Most of them are experiments just a little beyond the prototype stage, "minimum viable products" if you want to call them that. They all have in common…
sebastiangeiger
  • 3,386
  • 7
  • 29
  • 37
0
votes
1 answer

How to handle code reuse in this situation?

I started making an engine for HTML5 games. Soon, I got interested in another project, basically, an evolution simulation. The simulation would be ran on the server, but the actual rendering would take place on the client side. I realized that I…
corazza
  • 31,222
  • 37
  • 115
  • 186