I have to generate PL-SQL code, with some common code(invariable) and a variable code. I don't want to use any external tools.
Some ways that I can think:
Can I go and maintain the common code in a template and with markers, where my java code will generate code in the markers and generate a new file.
Maintain the common code in stati...
We have a very nice GoF book (Design Patterns: Elements of Reusable Object-Oriented Software) about patterns in Object Oriented Programming, and plenty of articles and resources in the web on this subject.
Are there any books (articles, resources) on patterns(best practices) for functional programming?
For dynamic programming in langua...
Hi all
I want to develop a system that is similar to calculation of salary. A salary has a basic value. On top of it, an employee can get some Bonus (es) or Penalties. Decorator Pattern seems to fit this scenario
Salary finalSalary = new HardworkBonus(new LateComingPenalty(new BasicSalary()))
System.out.println("Your total salary is : ...
Would using the adapter pattern be the best design to use when all you're trying to adapt to is a class that is holding fields and not methods or functions?
For example, would the following be the best way to approach this? I'm using C# if that makes any difference in your answers.
NewClass
private Guid _guidId;
AdpaterC...
Ok, the context is some serialization / deserialization code that will parse a byte stream into an 'object' representation that's easier to work with (and vice-versa).
Here's a simplified example with a base message class and then depending on a 'type' header, some more data/function are present and we must choose the right subclass to ...
Since web applications are mostly stateless, and linear (request comes in, response goes out), is change-tracking really necessary?
E.g. if I have an action that updates a Product instance I know at code-time what state I'm changing, I can just tell the repository "please update this instance".
To clarify, my question is about the chan...
For example, suppose I have a Product class that I can add to a shopping cart. I may want to be able to package it together with another item when it is also in the cart and add a 15% discount.
Should the product class be decorated with a new subclass allowing deals, or should product class be redesigned to allow the cart attach a price...
How many design-patterns can you name that are not GOF patterns?
Do you have any web-link that lists those names?
...
Currently, I create an object and use its setters to set the get/post data received from client. And call the validate() before calling the save() function like this:
//member registration
$m=new Member();
$m->setName($_POST['name']);
$m->setBirthDate($_POST['birthdate']);
$m->setAddress($_POST['address']);
$arrOfErrMsgs=$m->validate()...
For .Net there are lots of projects that Microsoft/others provide via which one can learn how patterns etc. are implemented in real life projects.
I am looking for ones for J2EE (apart from the samples that Sun provides on:http://java.sun.com/javaee/reference/code/). Am looking for more complex ones. May be using JSF/Spring/Struts
...
We are working on an image processing project using C# and EmguCV. Our team is composed of 3 people. To make faster progress, the 3 of us work on different sub-problems or experiment with different algorithms at the same time.
Currently each of us creates a function that contains the major code we are working at and all of us make chang...
Let's say I have a PHP Model-View-Controller framework that maps an address like http://site.com/admin/posts/edit/5 to an action that looks like
Posts_Controller::editAction($id)
in file /admin/controllers/posts.php
Now, many existing PHP frameworks that I've looked at would accomplish this by something similar to
$module = Router::...
have been searching the web and have not found any recommended MVP books.
in particular we are interested in: MVP, .NET C# and Winform (possibly migrating to WPF)
thanks for the help!
...
I have two different classes that share a common interface. Although the functionality is the same they work very differently internally. So naturally I want to test them both.
The best example I can come up with; I
serialize something to a file, one
class serialize it to plaintext, the
other to xml. The data (should) look
th...
Of course you can regard it as a kind of strategy, but that applies to almost all the design patterns. So : why?
...
So I have a structure like this:
Widget:
Component 1:
Component 2:
Component 3:
...
Component n:
I'm building an ASP.NET MVC web app that as part of its functionality will allow a user to create a Widget object and assign Component objects (which have a number of properties) as "children" of the Widget object. Users might ha...
Friends,
I am asking this question with performance as main concern. But I would like to know other possible advantages / disadvantages for both approaches.
The question is: Since properties are converted to methods in IL, could there be significant performance penalty if properties are called instead of accessing fields directly (from...
My understanding of a factory is that it encapsulates instantiation of concrete classes that all inherit a common abstract class or interface. This allows the client to be decoupled from the process of determining which concrete class to create, which in turn means you can add or remove concrete classes from your program without having t...
Please,
We have the following situation:
Component X that divides a request file into parts, sending each part to an independent processing component Y -through a network- that will reply with a result to component Z , component Z collects all the results of the file parts into a batch result file.
Note:- Request file: file contains ...
I’m looking for some advice. I recently wrapped up a project where I inherited some terrible code. I got the application running but it’s safe to say there are a number of performance and design issues, specifically with the advanced search functionality. I have now been asked to do a very similar project but much larger in scale. I have...