Questions tagged [reusability]

Reusability is the likelihood and potential for a piece of source code to be reused in other projects

In computer science and software engineering, reusability is the likelihood a segment of source code that can be used again to add new functionalities with slight or no modification. Reusable modules and classes reduce implementation time, increase the likelihood that prior testing and use has eliminated bugs and localizes code modifications when a change in implementation is required.

See: http://en.wikipedia.org/wiki/Reusability

974 questions
9
votes
5 answers

How to call multiple terminal operation on a Java stream

I know that whenever we call any terminal method on a stream, it gets closed. If we try to call any other terminal function on a closed stream it will result in a java.lang.IllegalStateException: stream has already been operated upon or…
Mehraj Malik
  • 14,872
  • 15
  • 58
  • 85
9
votes
4 answers

Writing reusable c# code for ASP.NET websites

I have been learning C# for the past few days for use with ASP.NET to create websites. I am very new to C# but I have been thinking about how I should go about writing my code to make it as reusable as possible. As a quick example, lets say I wanted…
Lucas
  • 10,476
  • 7
  • 39
  • 40
9
votes
3 answers

UITableViewCell - constraints only updated after reload

I have a custom UITableViewCell in which I have a UIView that contains multiple subviews. Depending on the cases, I hide some of those views, and I update constraints so that the parent UIView is still centered in my UITableViewCell. My issue is…
el-flor
  • 1,466
  • 3
  • 18
  • 39
9
votes
2 answers

How to implement reusable callback functions

I am fairly new to JavaScript and I am working in node which requires a good understanding of async programming and callback design. I have found that using embedded functions is very easy to do even when your callbacks are multiple levels deep. …
rss181919
  • 427
  • 1
  • 5
  • 16
9
votes
2 answers

Reuse expansion files on android developer console

How do I re-use an expansion file when updating an APK in developer console? When I upload a new apk with a higher versionCode, I can't select a previously used main expansion file... And if I upload the same expansion file again with the new apk,…
Gero
  • 1,842
  • 25
  • 45
8
votes
2 answers

What's the best practice to deploy (manage dependency) the django reusable apps in a real production project?

In our project we are using some django reusable apps, we are considering how to make the continuous and automatic deployment easy and painless. We have 2 options: option#1: use "pip install xxx" to install all dependencies reusable apps. Write…
Robert Mao
  • 1,911
  • 22
  • 24
8
votes
2 answers

Embedded view can not be found in ASP.NET Core MVC

I can't reuse my cshtml files from another assembly. Here's the bare-bone sample: Create an ASP.NET Core Web Application project with default template (using Web-Application, Model-View-Controller), and name it ViewReuse Add a class library called…
8
votes
1 answer

Reusing HttpClient for different users

I've been reading a lot about best practices when using HttpClient. Most people recommend reusing it for the lifetime of the application, even though it's IDisposable. My web application is communicating with various APIs, like Facebook Graph API,…
Jón Trausti Arason
  • 4,548
  • 1
  • 39
  • 46
8
votes
1 answer

Stop the reuse of custom cells Swift

I have an uitableview with a custom cell which gets data from the array. Custom cell has an uilabel and an uibutton (which is not visible until the uilabel text or the array object which loads for the text - is nil). On launch everything is fine.…
David Robertson
  • 1,561
  • 4
  • 19
  • 41
8
votes
5 answers

Reuse a Variable Multiple Times on an ASP.NET Page

I feel somewhat foolish asking such a simple question, but I can't seem to find an answer. I'm new to ASP.NET (C#), but I'm learning by building a simple set of web pages that display a report. I have a variable that represents a company name. I…
joshwbrick
  • 5,882
  • 9
  • 48
  • 72
8
votes
1 answer

Android: ViewHolder pattern and different types of rows?

ViewHolder pattern improves ListView scrolling framerate, as seen in following example: https://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html Is it possible to keep this pattern while using different…
tomash
  • 12,742
  • 15
  • 64
  • 81
8
votes
3 answers

How do I create a reusable partial for duplicate markup in ember.js?

Given this chunk of HTML:
krainboltgreene
  • 1,841
  • 2
  • 17
  • 25
8
votes
10 answers

Good strategies for developing throwaway code?

I frequently write throwaway code (in a research environment) - for example to explore an algorithm or a model for a scientific property or process. Many of these "experiments" are one-off but sometimes I find that I need to use a few later. For…
peter.murray.rust
  • 37,407
  • 44
  • 153
  • 217
8
votes
2 answers

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…
Andrei Rînea
  • 20,288
  • 17
  • 117
  • 166
7
votes
4 answers

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…
BlackWasp
  • 4,933
  • 2
  • 30
  • 42