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

Cannot assign value of type '()' to type 'UIView?'

I created a view for reuse. My plan is this: Show the same thing on ViewController with different content depending on the type. On view, you need to change the Label and background.The data comes from the server, for this I created the ViewModel.…
jojiReptiloid
  • 286
  • 1
  • 10
-1
votes
2 answers

How to implement GestureDetector in reuseable class widget?

I am successfully able to make a reusable stateful widget and added text but don't know about how to make reusable gesture detector class HomeScreen extends StatefulWidget { final String collectionName; HomeScreen(this.collectionName); …
-1
votes
1 answer

How do I make this function reusable?

How do I make this function reusable by passing 2 parameters, totalPrice and currentPrice. This is the code (it works perfectly, but I want this to be in a separate function so I could use it later on): $(".btn-quantity").on('click', function ()…
Dipzera
  • 95
  • 9
-1
votes
1 answer

What is the best way to share common properties in multiple classes?

What is the best way to share common properties in multiple classes ? For example: Class A { int a; int b; int c; } Class B { int a; int b; int d; } Since properties a and b in this example are getting duplicated, what would be the best way to…
-1
votes
1 answer

What's the best way to pass parameters to a function without tightly coupling with parameter type?

I have two structs each with integer fields a, b. Now I want to write a function called sum which results a+b type Type1 struct { a int64 b int64 } type Type2 struct { a int64 b int64 } func sum(details Type1) int64 { return…
mourya venkat
  • 267
  • 3
  • 10
-1
votes
1 answer

Include razor views in a shared project

I have CSS, Javascript, classes and partial views for a grid with lots of sorting and filtering options. I'd like to include it all in a shared project in Visual Studio so that I can reuse it in different apps. The CSS, Javascript, and classes…
t_m27
  • 103
  • 16
-1
votes
1 answer

Why UITableViewCell needs to be registered?

these are all codes in my demo: import UIKit class TableViewController: UITableViewController { var numberOfCell = 0 @IBAction func addAction() { numberOfCell = numberOfCell + 1 tableView.reloadData() } override…
K.B.
  • 291
  • 2
  • 13
-1
votes
3 answers

Reuse parent ViewController storyboard file in Child ViewController

Presenting ViewController Using storyBoard: if newViewController is in StoryBoard.we can present it using the following method. let storyboard = UIStoryboard(name: "AViewController"), bundle: UIBundle.main) let newViewcontroller =…
Manikandan
  • 1,195
  • 8
  • 26
-1
votes
1 answer

Objective-C : Design tall xib over view and add to storyboard with scrollview

i am using Xcode 8.1 I design component for user info by xib file and add to storyboard but i have a issue The user info is very many controls and i have to set freedom for xib i don't know xib's height Please step by step for me Thank you very much
-1
votes
2 answers

How to separate gui from logic in C++ (pattern and library necessary to comunicate 2 executable file)

I want make a program in c++ but I want also reuse my code to compile it in multiple operating system and architecture reducing the most possible the changes at code. So I must create a gui executable and a logic executable so that: for executable…
n3o
  • 69
  • 1
  • 2
  • 11
-1
votes
1 answer

Stopping a UITableViewCell button from being reused

I have a table view full of songs, each cell has a Play button. Once you press the Play button the song plays and the Play button in the individual cell turns to a Stop button. Now this cell was done using View Tags, so when you scroll down…
pennyloaf
  • 90
  • 7
-1
votes
2 answers

Is it better to handle object creation inside the function or add it to the parameter list

This question is programming language agnostic, but IMO it`s an important one. As you know, writing reusable code is a mix of science and art, and its a crucial skill any developer must have for writing great code. Assume I have a class which…
Qwerty
  • 748
  • 1
  • 9
  • 25
-1
votes
2 answers

Reuse an onclick event

In an existing application I have the option to add some jQuery code, but cannot change the existing code. The application has several buttons with unique ID's. Now based on which button is clicked I would like to trigger an additional event next…
-1
votes
2 answers

Android: Reusability of code by creating a library project

I am trying to create a library project to reuse certain things which are common in many applications like splash screen, login screen, asynchronous thread calls for getting data from a URL, custom listView, DAO files, etc. I want to import this…
-1
votes
2 answers

Proper way to free and reuse a thread

I'm using Delphi XE2 and my application is used to notify about new records in twitter/rss. In my application I use 2 threads to grab some data from twitter & rss every second. Here is the code: type section: TWarframeEvent=record GUID:…
1 2 3
64
65