Tagged Questions
8
votes
6answers
269 views
Interpretation of DRY principle
Right now I'm struggling with this concept of DRY (Don't Repeat Yourself) in my coding. I'm creating this function in which I'm fearing it's becoming too complex but I'm trying to follow the DRY ...
0
votes
0answers
69 views
initial Class design: access modifiers and no-arg constructors
Context:
Student working through Class design in personal/side project for Summer. I've never written anything implemented by others or had to maintain code. Trying to maximize encapsulation and ...
9
votes
5answers
389 views
OOP :What are some of the situations in which class based design is better than interface based one?
I was reading JDOM's website.
Why is the JDOM API defined in terms of concrete classes rather than interfaces?
Jason Hunter summarizes the arguments against an interface-based API for JDOM:
...
2
votes
2answers
107 views
Replacing dao layer
I am developing a series of webservices (based on spring and spring mvc).
For the first time in my dev career I do plan on replacing the dao layer in the future(I have always seen it mentioned but ...
5
votes
3answers
136 views
When is 'cloning', rather than reusing, a module acceptable design solution?
For this question, I'll give an example module to facilitate the discussion, Let's say the module is a calculation engine, It currently servers its purpose for its current audience. The requirement is ...
1
vote
2answers
168 views
Designing complex query builders in java/jpa/hibernate
I need to build complex sql queries programatically, based on large filter conditions.
For example, below are few sample/hypothitical filter conditions, based on which i need to fetch users
Country: ...
3
votes
3answers
106 views
Designing an API on top with Java RMI and Rest APIs
I'm working on the backend of a java web application. We have a document repository (Fedora Commons specifically) where we house xml files. I want to abstract the API of the repository internally so ...
2
votes
1answer
90 views
What are the design decisions involved in choosing how to expose a Java web application?
There are many ways to expose a Java web application to the consumer: application container (JBoss etc), servlet container (Tomcat etc), OSGi (Knopflerfish etc), self-executable WAR (Winstone etc) and ...
1
vote
1answer
122 views
Separating model from UI
I have a Swing application with a custom TreeModel that can refer to domain instances. I'm wondering what changes I could make if I consider moving to a web interface later on. Would a pluggable model ...
-3
votes
2answers
136 views
How to effectively design a piece of software [closed]
Im a compsci student and I've got some experience in various languages and paradigms
c/java/python/ruby/html/css/scheme/sql/asp(classic).
I realise that I want to have some software in my portfolio ...
0
votes
2answers
100 views
Should Business Interfaces be part of the Model layer?
In an oriented-services enterprise application, isn't it an antipattern to mix Service APIs (containing interface that external users depends on) with Model objects (entities, custom exceptions ...
0
votes
2answers
203 views
how should I design Objects around this business requirement?
This is the business requirement:
"
A Holiday Package (e.g. New York NY Holiday Package) can be offered in different ways based on the Origin city:
From New Delhi to NY
From Bombay to NY
NY itself ...
12
votes
5answers
381 views
Do ORMs enable the creation of rich domain models?
After using Hibernate on most of my projects for about 8 years, I've landed on a company that discourages its use and wants applications to only interact with the DB through stored procedures.
After ...
1
vote
1answer
95 views
DDD and validation of aggregate root
Suppose an aggregate root : MailConfiguration (wrapping an AddressPart object). The AddressPart object is a simple immutable value object with some fields like senderAdress, recipentAddress (to make ...
2
votes
4answers
188 views
JSF for an internet facing, high traffic web application
I, perhaps, made a wrong choice of going with a Component-based Framework like JSF for an internet facing, high traffic web application.
Development with JSF has although been easier but what I fear ...
0
votes
0answers
127 views
When perfectionism and motivation for good coding can lead to “drama” [closed]
A good programmer expects to learn everything that could get him better and more professional days after days by reading books, articles, forums like this site and more and more...
Actually, I work ...
1
vote
4answers
257 views
Looking for a better Factory pattern (Java)
After doing a rough sketch of a high level object model, I am doing iterative TDD, and letting the other objects emerge as a refactoring of the code (as it increases in complexity). (That whole ...
2
votes
3answers
175 views
Exporting huge data into XLS in a web application
I am developing a web application in Java/J2EE, in which I have export functionality.
I have used Jasper for the same. The issue is when trying to export a huge set of data it is consuming a lot of ...
1
vote
1answer
153 views
When using Java Persistence API (JPA), which layer owns the entities?
When working with annotations on entities in JPA, do these entities belong to the model layer or the persistence layer?
Does there have to be some kind of clone of the entities (simple JavaBeans) in ...
5
votes
2answers
78 views
API design involving standard and custom settings
Suppose a class allows some kind of configuration that has some well-known default values but also has the option of defining a custom value. For example, suppose you want to let users configure a ...
7
votes
6answers
467 views
Difference between a service class and a Helper class
I would like to know what differentiates a Service class from a utility class or a helper class?
A class only with underlying methods calls the dao's is a service? Doesn't the usage of Helper ...
3
votes
6answers
165 views
How to resolve methods with the same name and parameter types?
In many cases, I want to write methods that have the same functionality for different types of inputs. This is easily accomplished by method overloading if the parameter types are different.
But ...
4
votes
2answers
162 views
Is there a way to handle nested Collections more elegantly?
My question is rather a design question. In my program I got to a data structure that looks something like this:
private ConcurrentHashMap<A, ConcurrentHashMap<B, ConcurrentHashMap<Integer, ...
19
votes
11answers
782 views
Choose code design effort or laziness in Bank world
I've worked for two years in a great Investment Bank.
I made some technical projects with the desire of creating code the most optimized, respecting the adapted good design patterns, SOLID principle, ...
1
vote
2answers
136 views
Am I misusing instance initialization?
I often write tests when I need to set data object for integration tests involving a few pages with forms. Herein each form on a page could be represented by a different data object class. There are ...
4
votes
3answers
207 views
Right multi object dependance design
I need some help with a correct design.
I have a class called BufferManager. The push() method of this class reads data from a source and pushes it to a buffer repeatedly until there is no more data ...
1
vote
1answer
154 views
Drag and drop application design
I am hoping to create a mind-mapping like application and it needs to have a central workspace that will hold the map. Users should be able to drag items (like rectangles, texts, etc.) from a ...
0
votes
2answers
102 views
How can I efficiently handle input data without a framework?
I am working on a very small project and my design would be using technologies such as JSP, servlets, and POJOs.
I'm considering a workflow where a JSP page will receive input data, then submit it to ...
1
vote
2answers
175 views
Database design
I'm on the way developing an application which requires a kind of dynamic database,
So this is what I want,
This is the for reading the details of a class, the number of variables and methods ...
3
votes
3answers
302 views
Is JavaBeans a good example of encapsulation?
I'm trying to understand if JavaBeans is a good example of encapsulation. In my view, it's not as usually all the internal state is exposed through getters and setters.
A simple example is
public ...