Is it ‘safe’ to expect myClasses to agree not to only call package Scope methods from other Package scope methods?
The questions says it all, but a quick overview of the situation. I’m creating a Model which contains classes (all inherriting myObject) which have a large amount of interconnection. I want the controller to be able to create any of these objects any time, without modifying the Model. Only an explicit cal to the model to “AddToModel” would ‘install’ the object into the model (including updating all the connected objects). myObjects will use a factory pattern, if a user tries to create something already represented in the Model the already-instanced object in the model will be returned instead of constructing a new one.
Why is it a good idea for “lower” application layers not to be aware of “higher” ones?
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted. In a typical (well-designed) MVC web app, the database is not aware of the model code, the model code is not aware of the […]
Is it useful to use encapsulation in dynamic typed, interpreted programming language?
For what I know, encapsulation is useful because:
Is it useful to use encapsulation in dynamic typed, interpreted programming language?
For what I know, encapsulation is useful because:
Is it useful to use encapsulation in dynamic typed, interpreted programming language?
For what I know, encapsulation is useful because:
Is it useful to use encapsulation in dynamic typed, interpreted programming language?
For what I know, encapsulation is useful because:
Is it useful to use encapsulation in dynamic typed, interpreted programming language?
For what I know, encapsulation is useful because:
Go with an object-oriented perspective [duplicate]
If there’s a chance that you will reuse this code, then I would
probably make the effort to go with an object-oriented perspective.
Using the global namespace can be dangerous — you run the risk of
hard to find bugs due to variable names that get reused. Typically I
start by using an object-oriented approach for anything more than a
simple callback so that I don’t have to do the re-write thing. Any
time that you have a group of related functions in javascript, I
think, it’s a candidate for an object-oriented approach.
Go with an object-oriented perspective [duplicate]
If there’s a chance that you will reuse this code, then I would
probably make the effort to go with an object-oriented perspective.
Using the global namespace can be dangerous — you run the risk of
hard to find bugs due to variable names that get reused. Typically I
start by using an object-oriented approach for anything more than a
simple callback so that I don’t have to do the re-write thing. Any
time that you have a group of related functions in javascript, I
think, it’s a candidate for an object-oriented approach.
Go with an object-oriented perspective [duplicate]
If there’s a chance that you will reuse this code, then I would
probably make the effort to go with an object-oriented perspective.
Using the global namespace can be dangerous — you run the risk of
hard to find bugs due to variable names that get reused. Typically I
start by using an object-oriented approach for anything more than a
simple callback so that I don’t have to do the re-write thing. Any
time that you have a group of related functions in javascript, I
think, it’s a candidate for an object-oriented approach.