What do you call the design where the object's constructor is responsible for all/any subsequent actions. Usage of this class involves simply creating an instance and then it's all fire-and-forget.
A silly example:
public class Order
{
public Order(int ammount,Product type)
{
Ammount = ammount;
Namespace.OrderMana...
I have a maven project imported into Eclipse. I'm trying to understand the code pattern (architecture). What is the best way to do this?
will use any UML Eclipse plugin help on this?
will use sequence diagram, help on this?
what plugins should I use?
Please share your opinion.
...
We have the following class hierarchy:
public interface IManager {
object GetObject(int);
}
public class BaseManager : IManager ...
public class XManager : BaseManager {
...
public static XManager Instance;
}
public class YManager : BaseManager {
...
public static YManager Instance;
}
public static class ManagerFacade...
Is there already any collection of best practices for languages like Scala?
I've found a work on design patterns for functional languages here. There's GoF design patterns for oo languages. But are there any patterns for functional-oo hybrids? All I've seen is this list. Does anyone know any more?
...
Hi,
I started learning Iphone development.
As i'm reading about the cocoa development framework, few principal notions came around and with it a little bit of confusion.
I want to make sure I understand things right and to get a little clarification :
Delegate - basically the strategy design pattern. I set my class delegate and data so...
OK, I'm always trying to improve the way I code because it's my passion. I have a .dbml file (linq-to-sql) and I use it to access my MS SQL database.
Imagine, if you will, that you have a Person table in your database and you want to provide a way to delete,add,modify a Person record.
The way I'm handling things currently is creating ...
I need some links on various mobile development architectures and design patterns, for example, in iPhone Development MVC is been used, same like this, what are the various other architectures which are being used in mobile application development.
...
I've used the State pattern to implement a simple finite state machine. Looking at the description given on Wikipedia, and more specifically at the suggested Java implementation, I wondered why classes implementing the State interface (i.e. the various states) are not Singletons?
In the suggested implementation a new State is created wh...
Friends,
This Ask Tom thread which I found via another SO question, mentions Table and Transactional API's and I'm trying to understand the difference between them.
A Table API (TAPI) is where there is no access to the underlying tables and there are "getters" & "setters" to obtain information.
For example to select an address I ...
Hello Folks,
I want to know when should developers read and learn about design patterns? Is it in junior, senior, or beyond senior level?
This question is very fuzzy one for me.
...
In a desktop application that uses MVC, what object should be responsible for switching from one view to another? A controller at the next highest level of abstraction?
(Conceptual question not particular to language/platform.)
...
I have to make a web application that produces pages that contain panels with different setting configurations for different sites the page is hosted under.
For example, SiteA.com has a search panel with 3 select dropdowns and SiteB.com can have a search panel with 4 select dropdowns.
Can anyone offer any advice on how I could proceed...
I have two tables in the DB
FuelStation (fuel_station_id: int (PK), fuel_station_name: varchar, fuel_brand_id: int(FK))
FuelBrand (fuel_brand_id: int (PK), fuel_brand_name: varchar)
As we can see, both tables are linked via. foreign key (fuel_brand_id)
Now, I want to design an object model corresponding to the above data model but I...
Hi all,
I'm not really pro and find my question quite hard to describe, so please ask if anything is unclear:
I have an abstract class called BaseDevice.
Other devices, as Beacon and Transponder, inherit from BaseDevice.
For example the Beacon, it has the BaseClass methods PLUS its own properties and methods.
Let's say, the difference ...
Item 3 of Josh Block's Effective Java (Enforce the Singleton Property With a Private Constructor or an Enumerator) mentions that "While this approach has yet to be widely adopted, a single-element enum type is the best way to implement a singleton."
Example:
public enum Elvis {
INSTANCE;
private final String[] favorite...
From my readings, it seems that ScheduledExecutorService is the right way to start and stop timers in Java.
I need to port some code that starts and stops a timer. This is not a periodic timer. This code, stops the timer before starting it. So, effectively every start is really a restart(). I am looking for the right way to do this usin...
It seems that the observer design pattern is in built in C# through its event delegate model. Is there any reason where I may have to implement it in the classical way?
regards
123Developer
...
I'm working on a small online game where there is a need to store a reasonable amount of information about many (100+) different kinds of game objects.
I'm trying to decide whether to have this data generated by code or stored in some configuration file.
Data generation approach would be something like (in java-ish pseudo code):
(wit...
Hello I have been tasked with creating a fairly complex web application in php, it is to be a custom CMS that would be able to replicate the functionality and features provided by well known content management systems like WordPress, Joomla or Drupal. I am to try and integrate as much of the functionality that these well known and powerf...
At a conceptual level (not platform/framework specific), how should components like toolbars and menus (and the commands they contain) be implemented in a desktop application that uses the MVC pattern, with minimum coupling & maximum code reuse?
...