code-reuse

Under ExtJS 4 is there a way to load external components?

馋奶兔 提交于 2019-12-21 18:44:11
问题 I am trying to set up my ExtJS 4 project so I have three top level applications, for example, /foo/app.js /bar/app.js /baz/app.js Each 'top level' application is a separate ExtJS application, each with their own loaders. There are some cases were I will have general components that I want to share between all three applications, so I have /components top level directory. If I have a component name say ComponentA, /components/componenta.js How would I go about getting ComponentA into all three

javascript BEST PRACTICE - managing scripts / code reuse

谁说胖子不能爱 提交于 2019-12-21 11:55:33
问题 From reading many articles, such as How do I include a JavaScript file in another JavaScript file? - it is apparently not possible to include one script into another. So here's my question - I'm concerned about JS bloat. or having too much unused code loading with pages that don't use/need it. However, occasionally, I'll need the same functions on multiple pages, but not all pages. If we look at making logical sections of an online application into objects, such as 'customers' or 'items' - we

How can I promote code reuse in a manner similar to mixins/method modifiers/traits in other languages?

£可爱£侵袭症+ 提交于 2019-12-21 04:11:32
问题 I'm working on some code that interfaces to a database schema that models a persistent graph. Before I go into the details of my specific question, I thought it might help to provide some motivation. My schema is around books, people and author roles. A book has many author roles, where each role has a person. However, instead of allowing direct UPDATE queries on book objects, you must create a new book, and make modifications to the new version. Now, back to Haskell land. I am currently

Coding Priorities: Performance, Maintainability, Reusability?

自作多情 提交于 2019-12-20 12:39:45
问题 This came about mainly due to answers to SQL questions. UDF's and Sub Queries are intentionally omitted because of performance. I didn't include reliability not that it should be taken for granted, but the code has to work. Does performance always come first? So many answers are provided with performance as the main priority. My users seem to be more concerned with how quickly the code can be modified. So a report takes 15 seconds instead of 12 to run. They can live with that as long as I'm

How do I create and maintain a code reuse library?

a 夏天 提交于 2019-12-20 09:43:05
问题 I am trying to setup a repository of reusable code. I was thinking about having each reusable code module have a certain “Maturity Level” rating. The rating would be defined as the level at which a reusable code lies within a certain set of requirements. The highest maturity level will be the highest degree of standard across a predefined set of requirements. For example: Level; Requirements; Description Level 0; Code is legal to use; Is the code legal to use in commercial industry/across

Derive overloaded operator, but operate on same types only

旧时模样 提交于 2019-12-20 06:28:19
问题 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 Base& B) const { return Base(value+B.value); } }; class final Derived1 : public Base { public: Derived1(double value) : Base(value) {} }; class final Derived2 : public Base { public: Derived2(double value) : Base(value) {} }; I want to accomplish the following: int main(int

Rules are deprecated, what's instead (TSQL)?

依然范特西╮ 提交于 2019-12-19 09:16:08
问题 Rules (Transact-SQL)[1] are reusable what permitted to overcome the shortcoming of non-re-usability of check constraints. And now I read [1] that: "This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. We recommend that you use check constraints instead. Check constraints are created by using the CHECK keyword of CREATE TABLE or ALTER TABLE" So, what is

Rules are deprecated, what's instead (TSQL)?

*爱你&永不变心* 提交于 2019-12-19 09:16:06
问题 Rules (Transact-SQL)[1] are reusable what permitted to overcome the shortcoming of non-re-usability of check constraints. And now I read [1] that: "This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. We recommend that you use check constraints instead. Check constraints are created by using the CHECK keyword of CREATE TABLE or ALTER TABLE" So, what is

Doubts on concurrency with objects that can be used multiple times like formatters

主宰稳场 提交于 2019-12-19 07:55:32
问题 Maybe a stupid question to ask but I need some confirmations on it. Usually, when I deal with objects that can be used multiple times within my application I use an approach like the following. Create an extension, say for example NSDecimalNumber+Extension , or a class utility where a number formatter is created like the following. + (NSNumberFormatter*)internal_sharedNumberFormatter { static NSNumberFormatter* _internal_numberFormatter = nil; static dispatch_once_t onceToken; dispatch_once(

Doubts on concurrency with objects that can be used multiple times like formatters

笑着哭i 提交于 2019-12-19 07:55:07
问题 Maybe a stupid question to ask but I need some confirmations on it. Usually, when I deal with objects that can be used multiple times within my application I use an approach like the following. Create an extension, say for example NSDecimalNumber+Extension , or a class utility where a number formatter is created like the following. + (NSNumberFormatter*)internal_sharedNumberFormatter { static NSNumberFormatter* _internal_numberFormatter = nil; static dispatch_once_t onceToken; dispatch_once(