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
7
votes
1 answer

Reusing lists in patterns

When I write: sort [x] = [x] Is the compiler smart enough to reuse the same list, or do I have to be explicit about it? sort xs@[_] = xs
fredoverflow
  • 256,549
  • 94
  • 388
  • 662
7
votes
1 answer

Reusing an instance of NSURLConnection

I'm using an instance of NSURLConnection on the iPhone to request data from a server, managed by a delegate as usual. The requests are quite frequent (maybe once every 2 minutes say) and have a common and fixed URL. Rather than seeing the good…
Ken
  • 30,811
  • 34
  • 116
  • 155
7
votes
3 answers

Angular 2/4. Reuse strategy. How to inform component it's been reused?

We work with NG2/4 stuff. We have implemented a custom reuse strategy to perfrom the navigation from summary to details screens so we have the summary screen stay in same state (prevent it from recreation) when a user clicks back button. The thing…
Damask
  • 1,754
  • 1
  • 13
  • 24
7
votes
4 answers

How to reuse Cucumber step definition with a table for the last parameter?

This code: Then %{I should see the following data in the "Feeds" data grid: | Name | | #{name} |} And this one: Then "I should see the…
Nek
  • 1,909
  • 20
  • 31
7
votes
3 answers

Reusing Components in Angular 2

When I started using Angular 2 I had the idea that the main reason to create components is because you can reuse them. EG: button 1 button 2 Is it the case…
BeniaminoBaggins
  • 11,202
  • 41
  • 152
  • 287
7
votes
13 answers

Other uses of version control than for code?

Seeing this: http://www.suckless.org/wiki.html. A wiki based on Mercurial. Are there any other non-code related use to version control? Is there any other projects that uses version control tools inside instead of programming their own specific…
Loki
  • 29,950
  • 9
  • 48
  • 62
7
votes
3 answers

Should you pass member variables within member functions?

Sort of a style question here. Say I have a class A which has to do a sequence of reasonably complex things to its member variable B b class A { public: void DoStuffOnB(){ DoThing1(); DoThing2(); DoThing3(); } private: B b; void…
Aurelius
  • 1,146
  • 2
  • 13
  • 25
7
votes
6 answers

Rotate a custom UITableViewCell

I have a custom UITableViewCell which contains several UIButtons. Each button's frame position is relative to the cell width. I set autoresizingMask=UIViewAutoresizingFlexibleWidth so it will adjust the cell width and the button positions properly…
Wayne Lo
  • 3,689
  • 2
  • 28
  • 28
7
votes
4 answers

How reusable should ViewModel classes be?

I'm working on a WPF application, and I'm structuring it using the MVVM pattern. Initially I had an idea that the ViewModels should be reusable, but now I'm not too sure anymore. Should I be able to reuse my ViewModels if I need similar…
stiank81
  • 25,418
  • 43
  • 131
  • 202
7
votes
2 answers

Re-using Redigo connection instead of recreating it every time

Connecting to Redigo and manipulating data inside a function is easy like butter, but the problem comes when you have to re-use its connection, obviously for performance/practicality reasons. Doing it inside a function like this works: func main()…
user3717756
7
votes
1 answer

Reusable UITableView's prototype cell

I want to create a prototype cell which can be used in different table view via the storyboard.. What is the right way to do this? Any pointers appreciated.
user3431473
  • 117
  • 4
7
votes
3 answers

Any way to reuse Bindings in WPF?

I'm getting to the point in a WPF application where all of the bindings on my controls are getting quite repetitive and also a little too verbose. Also if I want to change this binding I would have to change it in various places instead of just one.…
jpierson
  • 16,435
  • 14
  • 105
  • 149
7
votes
10 answers

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…
Jiho Han
  • 1,610
  • 1
  • 19
  • 41
7
votes
2 answers

Wicket - Reusable panels with java inheritance

I have following java classes: I have a two form components which are mapped to Type1Task and Type2Task with a CompoundPropertyModel: Problem: Duplicate Code. I want the D and E Fields to map to a task, not the task types. Is there any way to…
David Sonnenfeld
  • 688
  • 5
  • 17
  • 31
7
votes
3 answers

UITableViewCell frame height not matching tableView:heightForRowAtIndexPath:

I'm constructing a UITableView with variable height custom table cells, their height determined by the size of a contained multi-line UILabel. I've got the tableView:heightForRowAtIndexPath: delegate method wired up and calculating the final height…
JK Laiho
  • 3,538
  • 6
  • 35
  • 42