You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Zahid Rahman <za...@gmail.com> on 2019/12/12 05:13:07 UTC

Java Singleton , Framework Design Patterns

Hi,

It is my understanding  that Design Patterns like the Java singleton is
used by framework developers. I.e. the Bean is a singleton.

It is also my assumption that the Java Singleton came in to being because
Java is a  network centric ground up construction.

I don't think I will ever use  the keywords singleton or instanceof as an
application developer. It is my view that the intended audience for these
language features are framework developers not application developers.

I have purchased a number of books, all are incorrect and misleading if my
view correct.

I don't believe these language features came into being as "acts of God" ,
but scientific realisations that these features are required.

So my point is I have not been able to find accurate information , if some
one could furnish me a Java language specification or recommend  a book
which accurately describes these I would be grateful.

I feel this would be the right place to seek such information because
there are framework developers  here.


Regards

Zahid

Re: Java Singleton , Framework Design Patterns

Posted by Martin Gainty <mg...@hotmail.com>.
if your client will want to switch containers to Jetty,Jboss <or any other container besides TC>
then you dont HAVE TO use tomcat dbcp alternative
and instead should use commons-dbcp-2.x as commons-dbcp-2.x works with ALL CONTAINERS

https://commons.apache.org/proper/commons-dbcp/
DBCP – Overview - Apache Commons<https://commons.apache.org/proper/commons-dbcp/>
The DBCP Component. Many Apache projects support interaction with a relational database. Creating a new connection for each user can be time consuming (often requiring multiple seconds of clock time), in order to perform a database transaction that might take milliseconds.
commons.apache.org

HTH
m.
________________________________
From: Zahid Rahman <za...@gmail.com>
Sent: Monday, December 16, 2019 2:50 PM
To: Struts Users Mailing List <us...@struts.apache.org>
Subject: Re: Java Singleton , Framework Design Patterns

> i prefer thread-safe implementations

> Sometimes we need to have only one instance of our class for example a
single DB connection shared by multiple objects as creating a separate DB
connection for every object may be costly.

I ran a raw (without connection pooling) DB Connection test with the
following results (see below);
query time   8 ms
and DB connection time is 324.

So I am using thread safe connection pooling  strategies found here.
https://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html
Asynchronous Connection Retrieval
https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html
https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html








*connecting to Postgres Database .....John  Casserole  Y  2012-04-11Sandy
 Key Lime Tarts  N  2012-04-14Tom  BBQ  Y  2012-04-18Tina  Salad  Y
 2012-04-18 DB Connectime miiliseconds 324 query time taken miiliseconds
8Connection + query time miiliseconds 335*
















































*import java.sql.Connection;import java.sql.DriverManager;import
java.sql.ResultSet;import java.sql.Statement;public class QueryTable {
public static void main(String[] args) { long Start = 0; long queryTime =
0; long connTime = 0; try { System.out.println("connecting to Postgres
Database ....."); Connection conn = null; Statement stmt = null; Start =
System.currentTimeMillis();         Class.forName("org.postgresql.Driver");
        conn = DriverManager
 .getConnection("jdbc:postgresql://localhost:5432/events",
 "postgres", "sunrise");                connTime =
System.currentTimeMillis();                stmt = conn.createStatement();
queryTime = System.currentTimeMillis(); ResultSet
rs=stmt.executeQuery("select * from potluck"); while(rs.next())
System.out.println(rs.getString("name")+"  "+
 rs.getString("food")+"  "+ rs.getString("confirmed")+"  "+
 rs.getString("signup_date")); conn.close();  } catch (Exception e){
System.out.println(e);}      long End = System.currentTimeMillis();
   System.out.println(" DB Connectime miiliseconds " +  (connTime - Start)
);      System.out.println(" query time taken miiliseconds " +  (End -
queryTime) );      System.out.println("Connection + query time miiliseconds
" +  (End - Start) );       }}*

On Fri, 13 Dec 2019 at 01:33, Martin Gainty <mg...@hotmail.com> wrote:

> Singleton:
> i prefer thread-safe implementations and generally eschew singletons
> (unless extreme political pressure dictates otherwise)
> https://www.geeksforgeeks.org/singleton-design-pattern/
> [https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png]<
> https://www.geeksforgeeks.org/singleton-design-pattern/>
> Singleton Design Pattern | Implementation - GeeksforGeeks<
> https://www.geeksforgeeks.org/singleton-design-pattern/>
> The singleton pattern is one of the simplest design patterns. Sometimes we
> need to have only one instance of our class for example a single DB
> connection shared by multiple objects as creating a separate DB connection
> for every object may be costly. Similarly, there can be a single
> configuration ...
> www.geeksforgeeks.org<http://www.geeksforgeeks.org>
>
> Design Patterns:
> have a look at this discussion from stackoverflow on Visitor Pattern vs
> Command Pattern for lambda expresssions
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter
> [
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded
> ]<
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> interface - Java Pass Method as Parameter - Stack Overflow<
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> In Java 8, you can now pass a method more easily using Lambda Expressions
> and Method References. First, some background: a functional interface is an
> interface that has one and only one abstract method, although it can
> contain any number of default methods (new in Java 8) and static methods. A
> lambda expression can quickly implement the abstract method, without all
> the unnecessary syntax ...
> stackoverflow.com
> although this discussion is more specific on when to implement Visitor
> Pattern vs when to use Command Pattern
>
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> [
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded
> ]<
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> >
> Command Pattern vs. Visitor Pattern - Stack Overflow<
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> >
> Each pattern has it's own pros, cons and use cases. You can use Command
> pattern to . Decouple the invoker & receiver of command . Implement
> callback mechanism. Implement undo and redo functionality. Maintain a
> history of commands. Use Visitor pattern in below scenarios:. Similar
> operations have to be performed on objects of different types grouped in a
> structure ; You need to execute many ...
> stackoverflow.com
>
> ?am interested to know which topic prompts your question?
>
> /br/
> Martin
> ________________________________
> From: Lukasz Lenart <lu...@apache.org>
> Sent: Thursday, December 12, 2019 1:56 AM
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: Java Singleton , Framework Design Patterns
>
> czw., 12 gru 2019 o 06:13 Zahid Rahman <za...@gmail.com> napisał(a):
> > So my point is I have not been able to find accurate information , if
> some
> > one could furnish me a Java language specification or recommend  a book
> > which accurately describes these I would be grateful.
>
> Start with Gang of Four
> http://www.blackwasp.co.uk/gofpatterns.aspx
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Java Singleton , Framework Design Patterns

Posted by Zahid Rahman <za...@gmail.com>.
> i prefer thread-safe implementations

> Sometimes we need to have only one instance of our class for example a
single DB connection shared by multiple objects as creating a separate DB
connection for every object may be costly.

I ran a raw (without connection pooling) DB Connection test with the
following results (see below);
query time   8 ms
and DB connection time is 324.

So I am using thread safe connection pooling  strategies found here.
https://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html
Asynchronous Connection Retrieval
https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html
https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html








*connecting to Postgres Database .....John  Casserole  Y  2012-04-11Sandy
 Key Lime Tarts  N  2012-04-14Tom  BBQ  Y  2012-04-18Tina  Salad  Y
 2012-04-18 DB Connectime miiliseconds 324 query time taken miiliseconds
8Connection + query time miiliseconds 335*
















































*import java.sql.Connection;import java.sql.DriverManager;import
java.sql.ResultSet;import java.sql.Statement;public class QueryTable {
public static void main(String[] args) { long Start = 0; long queryTime =
0; long connTime = 0; try { System.out.println("connecting to Postgres
Database ....."); Connection conn = null; Statement stmt = null; Start =
System.currentTimeMillis();         Class.forName("org.postgresql.Driver");
        conn = DriverManager
 .getConnection("jdbc:postgresql://localhost:5432/events",
 "postgres", "sunrise");                connTime =
System.currentTimeMillis();                stmt = conn.createStatement();
queryTime = System.currentTimeMillis(); ResultSet
rs=stmt.executeQuery("select * from potluck"); while(rs.next())
System.out.println(rs.getString("name")+"  "+
 rs.getString("food")+"  "+ rs.getString("confirmed")+"  "+
 rs.getString("signup_date")); conn.close();  } catch (Exception e){
System.out.println(e);}      long End = System.currentTimeMillis();
   System.out.println(" DB Connectime miiliseconds " +  (connTime - Start)
);      System.out.println(" query time taken miiliseconds " +  (End -
queryTime) );      System.out.println("Connection + query time miiliseconds
" +  (End - Start) );       }}*

On Fri, 13 Dec 2019 at 01:33, Martin Gainty <mg...@hotmail.com> wrote:

> Singleton:
> i prefer thread-safe implementations and generally eschew singletons
> (unless extreme political pressure dictates otherwise)
> https://www.geeksforgeeks.org/singleton-design-pattern/
> [https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png]<
> https://www.geeksforgeeks.org/singleton-design-pattern/>
> Singleton Design Pattern | Implementation - GeeksforGeeks<
> https://www.geeksforgeeks.org/singleton-design-pattern/>
> The singleton pattern is one of the simplest design patterns. Sometimes we
> need to have only one instance of our class for example a single DB
> connection shared by multiple objects as creating a separate DB connection
> for every object may be costly. Similarly, there can be a single
> configuration ...
> www.geeksforgeeks.org
>
> Design Patterns:
> have a look at this discussion from stackoverflow on Visitor Pattern vs
> Command Pattern for lambda expresssions
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter
> [
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded
> ]<
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> interface - Java Pass Method as Parameter - Stack Overflow<
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> In Java 8, you can now pass a method more easily using Lambda Expressions
> and Method References. First, some background: a functional interface is an
> interface that has one and only one abstract method, although it can
> contain any number of default methods (new in Java 8) and static methods. A
> lambda expression can quickly implement the abstract method, without all
> the unnecessary syntax ...
> stackoverflow.com
> although this discussion is more specific on when to implement Visitor
> Pattern vs when to use Command Pattern
>
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> [
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded
> ]<
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> >
> Command Pattern vs. Visitor Pattern - Stack Overflow<
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> >
> Each pattern has it's own pros, cons and use cases. You can use Command
> pattern to . Decouple the invoker & receiver of command . Implement
> callback mechanism. Implement undo and redo functionality. Maintain a
> history of commands. Use Visitor pattern in below scenarios:. Similar
> operations have to be performed on objects of different types grouped in a
> structure ; You need to execute many ...
> stackoverflow.com
>
> ?am interested to know which topic prompts your question?
>
> /br/
> Martin
> ________________________________
> From: Lukasz Lenart <lu...@apache.org>
> Sent: Thursday, December 12, 2019 1:56 AM
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: Java Singleton , Framework Design Patterns
>
> czw., 12 gru 2019 o 06:13 Zahid Rahman <za...@gmail.com> napisał(a):
> > So my point is I have not been able to find accurate information , if
> some
> > one could furnish me a Java language specification or recommend  a book
> > which accurately describes these I would be grateful.
>
> Start with Gang of Four
> http://www.blackwasp.co.uk/gofpatterns.aspx
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Java Singleton , Framework Design Patterns

Posted by Zahid Rahman <za...@gmail.com>.
You have been very helpful.
Your information is very much along the same  lines I was headed.

Best Regards
Zahid

On Sat, 14 Dec 2019 at 12:19, Martin Gainty <mg...@hotmail.com> wrote:

> MG>maybe.. see below
>
> ________________________________
> From: Zahid Rahman <za...@gmail.com>
> Sent: Friday, December 13, 2019 5:09 PM
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: Java Singleton , Framework Design Patterns
>
> Hi,
>
> >?am interested to know which topic prompts your question ?
> As you can see from the log file (below) the spring framework creates and
> destroys a  singleton of a bean.
> So the singleton pattern is used by the container.
> I was also informed that the singleton is used to create a login screen.
> That also appears to be the case from the page
> http://www.blackwasp.co.uk/Singleton.aspx.
>
> The login screen I will be using is the login.java and login.jsp in the
> struts2  "blank app" in "struts-examples-master".
> The struts framework also helps me with duplicate form submission.
> So do I need to use the singleton pattern  ?
>
> MG>here is ted husted struts-blank login.java (un-edited)
> /*
>  * $Id: Login.java 471756 2006-11-06 15:01:43Z husted $
>  *
>  * Licensed to the Apache Software Foundation (ASF) under one
>  * or more contributor license agreements.  See the NOTICE file
>  * distributed with this work for additional information
>  * regarding copyright ownership.  The ASF licenses this file
>  * to you under the Apache License, Version 2.0 (the
>  * "License"); you may not use this file except in compliance
>  * with the License.  You may obtain a copy of the License at
>  *
>  *  http://www.apache.org/licenses/LICENSE-2.0
>  *
>  * Unless required by applicable law or agreed to in writing,
>  * software distributed under the License is distributed on an
>  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>  * KIND, either express or implied.  See the License for the
>  * specific language governing permissions and limitations
>  * under the License.
>  */
> package example;
> public class Login extends ExampleSupport {
>     public String execute() throws Exception {
>         if (isInvalid(getUsername())) return INPUT;
>         if (isInvalid(getPassword())) return INPUT;
>         return SUCCESS;
>     }
>     private boolean isInvalid(String value) {
>         return (value == null || value.length() == 0);
>     }
>     private String username;
>     public String getUsername() {
>         return username;
>     }
>     public void setUsername(String username) {
>         this.username = username;
>     }
>     private String password;
>     public String getPassword() {
>         return password;
>     }
>     public void setPassword(String password) {
>         this.password = password;
>     }
> }
>
> //no singleton yet as there is no public static ClassName getInstance()
> //with private constructor pointing to getInstance()
>
> //BUT singleton is used to instantate and set default ObjectFactory for
> XmlConfigurationProvider
> //as seen here in ConfigurationTestBase.java
> package com.opensymphony.xwork2.config.providers;
> public abstract class ConfigurationTestBase extends
> com.opensymphone.xwork2.XWorkTestCase {
>     protected com.opensymphony.xwork2.config.ConfigurationProvider
> buildConfigurationProvider(final String filename) {
>         configuration = new
> com.opensymphony.xwork2.config.providers.MockConfiguration();
>
> ((com.opensymphony.xwork2.config.providers.MockConfiguration)configuration).selfRegister();
>         container = configuration.getContainer();
>         XmlConfigurationProvider prov = new
> XmlConfigurationProvider(filename, true);
>
> prov.setObjectFactory(container.getInstance(com.opensymphony.xwork2.ObjectFactory.class));
>
> //but the provider does not use Spring Object Factory which we can remedy
> here
>
> prov.setObjectFactory(container.getInstance(com.opensymphony.xwork2.spring.SpringObjectFactory.class));
>
> //as you mention we must follow springs example of declaring singleton
> bean in ./WEB-INF/<application>context.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "
> http://www.springframework.org/dtd/spring-beans.dtd">
> <beans default-autowire="byName">
>     <bean id="default"
> class="com.opensymphony.xwork2.spring.SpringObjectFactory" singleton="true"
> />
>
> //where struts specifies default <Spring>ObjectFactory thru
> ./classes/org/apache/struts2/default.properties
> ### if specified, the default object factory can be overridden here
> ### Note: short-hand notation is supported in some cases, such as "spring"
> ###       Alternatively, you can provide a
> com.opensymphony.xwork2.ObjectFactory subclass name here
>
> struts.objectFactory=com.opensymphony.xwork2.spring.SpringObjectFactory.class
>
> //the line
> struts.objectFactory=com.opensymphony.xwork2.spring.SpringObjectFactory.class
> in default.properties should be sufficient
> //to route all instances of ObjectFactory to SpringObjectFactory
>
> does this help?
>
>  2019-12-13 21:01:06,882 [main] [DEBUG]
> o.s.b.f.s.DefaultListableBeanFactory - Pre-instantiating singletons in
>
> org.springframework.beans.factory.support.DefaultListableBeanFactory@6f1d30d
> :
> defining beans [numberGenerator]; root of factory hierarchy
> 2019-12-13 21:01:06,882 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
> - Creating shared instance of singleton bean 'numberGenerator'
> 2019-12-13 21:01:06,882 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
> - Creating instance of bean 'numberGenerator'
> 2019-12-13 21:01:06,895 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
> - Eagerly caching bean 'numberGenerator' to allow for resolving potential
> circular references
> 2019-12-13 21:01:06,896 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
> - Finished creating instance of bean 'numberGenerator'
> 2019-12-13 21:01:06,897 [main] [DEBUG]
> o.s.c.s.ClassPathXmlApplicationContext - Unable to locate
> LifecycleProcessor with name 'lifecycleProcessor': using default
> [org.springframework.context.support.DefaultLifecycleProcessor@d967f908]
> 2019-12-13 21:01:06,897 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
> - Returning cached instance of singleton bean 'lifecycleProcessor'
> 2019-12-13 21:01:06,900 [main] [DEBUG]
> o.s.c.e.PropertySourcesPropertyResolver - Could not find key
> 'spring.liveBeansView.mbeanDomain' in any property source
> 2019-12-13 21:01:06,910 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
> - Returning cached instance of singleton bean 'numberGenerator'
> 2019-12-13 21:01:06,910 [main] [INFO ] academy.learnprogramming.Main -
> number = 0
> 2019-12-13 21:01:06,912 [main] [INFO ]
> o.s.c.s.ClassPathXmlApplicationContext - Closing
> org.springframework.context.support.ClassPathXmlApplicationContext@3e92e10
> :
> startup date [Fri Dec 13 21:01:06 GMT 2019]; root of context hierarchy
> 2019-12-13 21:01:06,912 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
> - Returning cached instance of singleton bean 'lifecycleProcessor'
> 2019-12-13 21:01:06,912 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
> - Destroying singletons in
>
> org.springframework.beans.factory.support.DefaultListableBeanFactory@6f1d30d
> :
> defining beans [numberGenerator]; root of factory hierarchy
>
> On Fri, 13 Dec 2019 at 01:33, Martin Gainty <mg...@hotmail.com> wrote:
>
> > Singleton:
> > i prefer thread-safe implementations and generally eschew singletons
> > (unless extreme political pressure dictates otherwise)
> > https://www.geeksforgeeks.org/singleton-design-pattern/
> > [https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png]<
> > https://www.geeksforgeeks.org/singleton-design-pattern/>
> > Singleton Design Pattern | Implementation - GeeksforGeeks<
> > https://www.geeksforgeeks.org/singleton-design-pattern/>
> > The singleton pattern is one of the simplest design patterns. Sometimes
> we
> > need to have only one instance of our class for example a single DB
> > connection shared by multiple objects as creating a separate DB
> connection
> > for every object may be costly. Similarly, there can be a single
> > configuration ...
> > www.geeksforgeeks.org<http://www.geeksforgeeks.org>
> >
> > Design Patterns:
> > have a look at this discussion from stackoverflow on Visitor Pattern vs
> > Command Pattern for lambda expresssions
> >
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter
> > [
> >
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded
> > ]<
> >
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> > interface - Java Pass Method as Parameter - Stack Overflow<
> >
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> > In Java 8, you can now pass a method more easily using Lambda Expressions
> > and Method References. First, some background: a functional interface is
> an
> > interface that has one and only one abstract method, although it can
> > contain any number of default methods (new in Java 8) and static
> methods. A
> > lambda expression can quickly implement the abstract method, without all
> > the unnecessary syntax ...
> > stackoverflow.com
> > although this discussion is more specific on when to implement Visitor
> > Pattern vs when to use Command Pattern
> >
> >
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> > [
> >
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded
> > ]<
> >
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> > >
> > Command Pattern vs. Visitor Pattern - Stack Overflow<
> >
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> > >
> > Each pattern has it's own pros, cons and use cases. You can use Command
> > pattern to . Decouple the invoker & receiver of command . Implement
> > callback mechanism. Implement undo and redo functionality. Maintain a
> > history of commands. Use Visitor pattern in below scenarios:. Similar
> > operations have to be performed on objects of different types grouped in
> a
> > structure ; You need to execute many ...
> > stackoverflow.com
> >
> > ?am interested to know which topic prompts your question?
> >
> > /br/
> > Martin
> > ________________________________
> > From: Lukasz Lenart <lu...@apache.org>
> > Sent: Thursday, December 12, 2019 1:56 AM
> > To: Struts Users Mailing List <us...@struts.apache.org>
> > Subject: Re: Java Singleton , Framework Design Patterns
> >
> > czw., 12 gru 2019 o 06:13 Zahid Rahman <za...@gmail.com>
> napisał(a):
> > > So my point is I have not been able to find accurate information , if
> > some
> > > one could furnish me a Java language specification or recommend  a book
> > > which accurately describes these I would be grateful.
> >
> > Start with Gang of Four
> > http://www.blackwasp.co.uk/gofpatterns.aspx
> >
> >
> > Regards
> > --
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

Re: Java Singleton , Framework Design Patterns

Posted by Martin Gainty <mg...@hotmail.com>.
MG>maybe.. see below

________________________________
From: Zahid Rahman <za...@gmail.com>
Sent: Friday, December 13, 2019 5:09 PM
To: Struts Users Mailing List <us...@struts.apache.org>
Subject: Re: Java Singleton , Framework Design Patterns

Hi,

>?am interested to know which topic prompts your question ?
As you can see from the log file (below) the spring framework creates and
destroys a  singleton of a bean.
So the singleton pattern is used by the container.
I was also informed that the singleton is used to create a login screen.
That also appears to be the case from the page
http://www.blackwasp.co.uk/Singleton.aspx.

The login screen I will be using is the login.java and login.jsp in the
struts2  "blank app" in "struts-examples-master".
The struts framework also helps me with duplicate form submission.
So do I need to use the singleton pattern  ?

MG>here is ted husted struts-blank login.java (un-edited)
/*
 * $Id: Login.java 471756 2006-11-06 15:01:43Z husted $
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package example;
public class Login extends ExampleSupport {
    public String execute() throws Exception {
        if (isInvalid(getUsername())) return INPUT;
        if (isInvalid(getPassword())) return INPUT;
        return SUCCESS;
    }
    private boolean isInvalid(String value) {
        return (value == null || value.length() == 0);
    }
    private String username;
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    private String password;
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
}

//no singleton yet as there is no public static ClassName getInstance()
//with private constructor pointing to getInstance()

//BUT singleton is used to instantate and set default ObjectFactory for XmlConfigurationProvider
//as seen here in ConfigurationTestBase.java
package com.opensymphony.xwork2.config.providers;
public abstract class ConfigurationTestBase extends com.opensymphone.xwork2.XWorkTestCase {
    protected com.opensymphony.xwork2.config.ConfigurationProvider buildConfigurationProvider(final String filename) {
        configuration = new com.opensymphony.xwork2.config.providers.MockConfiguration();
        ((com.opensymphony.xwork2.config.providers.MockConfiguration)configuration).selfRegister();
        container = configuration.getContainer();
        XmlConfigurationProvider prov = new XmlConfigurationProvider(filename, true);
        prov.setObjectFactory(container.getInstance(com.opensymphony.xwork2.ObjectFactory.class));

//but the provider does not use Spring Object Factory which we can remedy here
        prov.setObjectFactory(container.getInstance(com.opensymphony.xwork2.spring.SpringObjectFactory.class));

//as you mention we must follow springs example of declaring singleton bean in ./WEB-INF/<application>context.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
    <bean id="default" class="com.opensymphony.xwork2.spring.SpringObjectFactory" singleton="true" />

//where struts specifies default <Spring>ObjectFactory thru ./classes/org/apache/struts2/default.properties
### if specified, the default object factory can be overridden here
### Note: short-hand notation is supported in some cases, such as "spring"
###       Alternatively, you can provide a com.opensymphony.xwork2.ObjectFactory subclass name here
struts.objectFactory=com.opensymphony.xwork2.spring.SpringObjectFactory.class

//the line struts.objectFactory=com.opensymphony.xwork2.spring.SpringObjectFactory.class in default.properties should be sufficient
//to route all instances of ObjectFactory to SpringObjectFactory

does this help?

 2019-12-13 21:01:06,882 [main] [DEBUG]
o.s.b.f.s.DefaultListableBeanFactory - Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@6f1d30d:
defining beans [numberGenerator]; root of factory hierarchy
2019-12-13 21:01:06,882 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Creating shared instance of singleton bean 'numberGenerator'
2019-12-13 21:01:06,882 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Creating instance of bean 'numberGenerator'
2019-12-13 21:01:06,895 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Eagerly caching bean 'numberGenerator' to allow for resolving potential
circular references
2019-12-13 21:01:06,896 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Finished creating instance of bean 'numberGenerator'
2019-12-13 21:01:06,897 [main] [DEBUG]
o.s.c.s.ClassPathXmlApplicationContext - Unable to locate
LifecycleProcessor with name 'lifecycleProcessor': using default
[org.springframework.context.support.DefaultLifecycleProcessor@d967f908]
2019-12-13 21:01:06,897 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Returning cached instance of singleton bean 'lifecycleProcessor'
2019-12-13 21:01:06,900 [main] [DEBUG]
o.s.c.e.PropertySourcesPropertyResolver - Could not find key
'spring.liveBeansView.mbeanDomain' in any property source
2019-12-13 21:01:06,910 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Returning cached instance of singleton bean 'numberGenerator'
2019-12-13 21:01:06,910 [main] [INFO ] academy.learnprogramming.Main -
number = 0
2019-12-13 21:01:06,912 [main] [INFO ]
o.s.c.s.ClassPathXmlApplicationContext - Closing
org.springframework.context.support.ClassPathXmlApplicationContext@3e92e10:
startup date [Fri Dec 13 21:01:06 GMT 2019]; root of context hierarchy
2019-12-13 21:01:06,912 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Returning cached instance of singleton bean 'lifecycleProcessor'
2019-12-13 21:01:06,912 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Destroying singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@6f1d30d:
defining beans [numberGenerator]; root of factory hierarchy

On Fri, 13 Dec 2019 at 01:33, Martin Gainty <mg...@hotmail.com> wrote:

> Singleton:
> i prefer thread-safe implementations and generally eschew singletons
> (unless extreme political pressure dictates otherwise)
> https://www.geeksforgeeks.org/singleton-design-pattern/
> [https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png]<
> https://www.geeksforgeeks.org/singleton-design-pattern/>
> Singleton Design Pattern | Implementation - GeeksforGeeks<
> https://www.geeksforgeeks.org/singleton-design-pattern/>
> The singleton pattern is one of the simplest design patterns. Sometimes we
> need to have only one instance of our class for example a single DB
> connection shared by multiple objects as creating a separate DB connection
> for every object may be costly. Similarly, there can be a single
> configuration ...
> www.geeksforgeeks.org<http://www.geeksforgeeks.org>
>
> Design Patterns:
> have a look at this discussion from stackoverflow on Visitor Pattern vs
> Command Pattern for lambda expresssions
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter
> [
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded
> ]<
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> interface - Java Pass Method as Parameter - Stack Overflow<
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> In Java 8, you can now pass a method more easily using Lambda Expressions
> and Method References. First, some background: a functional interface is an
> interface that has one and only one abstract method, although it can
> contain any number of default methods (new in Java 8) and static methods. A
> lambda expression can quickly implement the abstract method, without all
> the unnecessary syntax ...
> stackoverflow.com
> although this discussion is more specific on when to implement Visitor
> Pattern vs when to use Command Pattern
>
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> [
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded
> ]<
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> >
> Command Pattern vs. Visitor Pattern - Stack Overflow<
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> >
> Each pattern has it's own pros, cons and use cases. You can use Command
> pattern to . Decouple the invoker & receiver of command . Implement
> callback mechanism. Implement undo and redo functionality. Maintain a
> history of commands. Use Visitor pattern in below scenarios:. Similar
> operations have to be performed on objects of different types grouped in a
> structure ; You need to execute many ...
> stackoverflow.com
>
> ?am interested to know which topic prompts your question?
>
> /br/
> Martin
> ________________________________
> From: Lukasz Lenart <lu...@apache.org>
> Sent: Thursday, December 12, 2019 1:56 AM
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: Java Singleton , Framework Design Patterns
>
> czw., 12 gru 2019 o 06:13 Zahid Rahman <za...@gmail.com> napisał(a):
> > So my point is I have not been able to find accurate information , if
> some
> > one could furnish me a Java language specification or recommend  a book
> > which accurately describes these I would be grateful.
>
> Start with Gang of Four
> http://www.blackwasp.co.uk/gofpatterns.aspx
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Java Singleton , Framework Design Patterns

Posted by Zahid Rahman <za...@gmail.com>.
Hi,

>?am interested to know which topic prompts your question ?
As you can see from the log file (below) the spring framework creates and
destroys a  singleton of a bean.
So the singleton pattern is used by the container.
I was also informed that the singleton is used to create a login screen.
That also appears to be the case from the page
http://www.blackwasp.co.uk/Singleton.aspx.

The login screen I will be using is the login.java and login.jsp in the
struts2  "blank app" in "struts-examples-master".
The struts framework also helps me with duplicate form submission.
So do I need to use the singleton pattern  ?

 2019-12-13 21:01:06,882 [main] [DEBUG]
o.s.b.f.s.DefaultListableBeanFactory - Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@6f1d30d:
defining beans [numberGenerator]; root of factory hierarchy
2019-12-13 21:01:06,882 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Creating shared instance of singleton bean 'numberGenerator'
2019-12-13 21:01:06,882 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Creating instance of bean 'numberGenerator'
2019-12-13 21:01:06,895 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Eagerly caching bean 'numberGenerator' to allow for resolving potential
circular references
2019-12-13 21:01:06,896 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Finished creating instance of bean 'numberGenerator'
2019-12-13 21:01:06,897 [main] [DEBUG]
o.s.c.s.ClassPathXmlApplicationContext - Unable to locate
LifecycleProcessor with name 'lifecycleProcessor': using default
[org.springframework.context.support.DefaultLifecycleProcessor@d967f908]
2019-12-13 21:01:06,897 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Returning cached instance of singleton bean 'lifecycleProcessor'
2019-12-13 21:01:06,900 [main] [DEBUG]
o.s.c.e.PropertySourcesPropertyResolver - Could not find key
'spring.liveBeansView.mbeanDomain' in any property source
2019-12-13 21:01:06,910 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Returning cached instance of singleton bean 'numberGenerator'
2019-12-13 21:01:06,910 [main] [INFO ] academy.learnprogramming.Main -
number = 0
2019-12-13 21:01:06,912 [main] [INFO ]
o.s.c.s.ClassPathXmlApplicationContext - Closing
org.springframework.context.support.ClassPathXmlApplicationContext@3e92e10:
startup date [Fri Dec 13 21:01:06 GMT 2019]; root of context hierarchy
2019-12-13 21:01:06,912 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Returning cached instance of singleton bean 'lifecycleProcessor'
2019-12-13 21:01:06,912 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Destroying singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@6f1d30d:
defining beans [numberGenerator]; root of factory hierarchy

On Fri, 13 Dec 2019 at 01:33, Martin Gainty <mg...@hotmail.com> wrote:

> Singleton:
> i prefer thread-safe implementations and generally eschew singletons
> (unless extreme political pressure dictates otherwise)
> https://www.geeksforgeeks.org/singleton-design-pattern/
> [https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png]<
> https://www.geeksforgeeks.org/singleton-design-pattern/>
> Singleton Design Pattern | Implementation - GeeksforGeeks<
> https://www.geeksforgeeks.org/singleton-design-pattern/>
> The singleton pattern is one of the simplest design patterns. Sometimes we
> need to have only one instance of our class for example a single DB
> connection shared by multiple objects as creating a separate DB connection
> for every object may be costly. Similarly, there can be a single
> configuration ...
> www.geeksforgeeks.org
>
> Design Patterns:
> have a look at this discussion from stackoverflow on Visitor Pattern vs
> Command Pattern for lambda expresssions
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter
> [
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded
> ]<
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> interface - Java Pass Method as Parameter - Stack Overflow<
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> In Java 8, you can now pass a method more easily using Lambda Expressions
> and Method References. First, some background: a functional interface is an
> interface that has one and only one abstract method, although it can
> contain any number of default methods (new in Java 8) and static methods. A
> lambda expression can quickly implement the abstract method, without all
> the unnecessary syntax ...
> stackoverflow.com
> although this discussion is more specific on when to implement Visitor
> Pattern vs when to use Command Pattern
>
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> [
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded
> ]<
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> >
> Command Pattern vs. Visitor Pattern - Stack Overflow<
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> >
> Each pattern has it's own pros, cons and use cases. You can use Command
> pattern to . Decouple the invoker & receiver of command . Implement
> callback mechanism. Implement undo and redo functionality. Maintain a
> history of commands. Use Visitor pattern in below scenarios:. Similar
> operations have to be performed on objects of different types grouped in a
> structure ; You need to execute many ...
> stackoverflow.com
>
> ?am interested to know which topic prompts your question?
>
> /br/
> Martin
> ________________________________
> From: Lukasz Lenart <lu...@apache.org>
> Sent: Thursday, December 12, 2019 1:56 AM
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: Java Singleton , Framework Design Patterns
>
> czw., 12 gru 2019 o 06:13 Zahid Rahman <za...@gmail.com> napisał(a):
> > So my point is I have not been able to find accurate information , if
> some
> > one could furnish me a Java language specification or recommend  a book
> > which accurately describes these I would be grateful.
>
> Start with Gang of Four
> http://www.blackwasp.co.uk/gofpatterns.aspx
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Java Singleton , Framework Design Patterns

Posted by Martin Gainty <mg...@hotmail.com>.
Singleton:
i prefer thread-safe implementations and generally eschew singletons (unless extreme political pressure dictates otherwise)
https://www.geeksforgeeks.org/singleton-design-pattern/
[https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png]<https://www.geeksforgeeks.org/singleton-design-pattern/>
Singleton Design Pattern | Implementation - GeeksforGeeks<https://www.geeksforgeeks.org/singleton-design-pattern/>
The singleton pattern is one of the simplest design patterns. Sometimes we need to have only one instance of our class for example a single DB connection shared by multiple objects as creating a separate DB connection for every object may be costly. Similarly, there can be a single configuration ...
www.geeksforgeeks.org

Design Patterns:
have a look at this discussion from stackoverflow on Visitor Pattern vs Command Pattern for lambda expresssions
https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter
[https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded]<https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
interface - Java Pass Method as Parameter - Stack Overflow<https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
In Java 8, you can now pass a method more easily using Lambda Expressions and Method References. First, some background: a functional interface is an interface that has one and only one abstract method, although it can contain any number of default methods (new in Java 8) and static methods. A lambda expression can quickly implement the abstract method, without all the unnecessary syntax ...
stackoverflow.com
although this discussion is more specific on when to implement Visitor Pattern vs when to use Command Pattern
https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
[https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded]<https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern>
Command Pattern vs. Visitor Pattern - Stack Overflow<https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern>
Each pattern has it's own pros, cons and use cases. You can use Command pattern to . Decouple the invoker & receiver of command . Implement callback mechanism. Implement undo and redo functionality. Maintain a history of commands. Use Visitor pattern in below scenarios:. Similar operations have to be performed on objects of different types grouped in a structure ; You need to execute many ...
stackoverflow.com

?am interested to know which topic prompts your question?

/br/
Martin
________________________________
From: Lukasz Lenart <lu...@apache.org>
Sent: Thursday, December 12, 2019 1:56 AM
To: Struts Users Mailing List <us...@struts.apache.org>
Subject: Re: Java Singleton , Framework Design Patterns

czw., 12 gru 2019 o 06:13 Zahid Rahman <za...@gmail.com> napisał(a):
> So my point is I have not been able to find accurate information , if some
> one could furnish me a Java language specification or recommend  a book
> which accurately describes these I would be grateful.

Start with Gang of Four
http://www.blackwasp.co.uk/gofpatterns.aspx


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Java Singleton , Framework Design Patterns

Posted by Zahid Rahman <za...@gmail.com>.
Thanks v. Much

On Thu, 12 Dec 2019, 21:37 , <jt...@mchsi.com> wrote:

> If you want a definitive Java source -
> https://docs.oracle.com/javase/tutorial/
>
> ----- Original Message -----
> From: "Lukasz Lenart" <lu...@apache.org>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Thursday, December 12, 2019 12:56:05 AM
> Subject: Re: Java Singleton , Framework Design Patterns
>
> czw., 12 gru 2019 o 06:13 Zahid Rahman <za...@gmail.com> napisał(a):
> > So my point is I have not been able to find accurate information , if
> some
> > one could furnish me a Java language specification or recommend  a book
> > which accurately describes these I would be grateful.
>
> Start with Gang of Four
> http://www.blackwasp.co.uk/gofpatterns.aspx
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Java Singleton , Framework Design Patterns

Posted by jt...@mchsi.com.
If you want a definitive Java source - https://docs.oracle.com/javase/tutorial/

----- Original Message -----
From: "Lukasz Lenart" <lu...@apache.org>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, December 12, 2019 12:56:05 AM
Subject: Re: Java Singleton , Framework Design Patterns

czw., 12 gru 2019 o 06:13 Zahid Rahman <za...@gmail.com> napisał(a):
> So my point is I have not been able to find accurate information , if some
> one could furnish me a Java language specification or recommend  a book
> which accurately describes these I would be grateful.

Start with Gang of Four
http://www.blackwasp.co.uk/gofpatterns.aspx


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Java Singleton , Framework Design Patterns

Posted by Zahid Rahman <za...@gmail.com>.
Thanks v. Much

On Thu, 12 Dec 2019, 06:56 Lukasz Lenart, <lu...@apache.org> wrote:

> czw., 12 gru 2019 o 06:13 Zahid Rahman <za...@gmail.com> napisał(a):
> > So my point is I have not been able to find accurate information , if
> some
> > one could furnish me a Java language specification or recommend  a book
> > which accurately describes these I would be grateful.
>
> Start with Gang of Four
> http://www.blackwasp.co.uk/gofpatterns.aspx
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Java Singleton , Framework Design Patterns

Posted by Lukasz Lenart <lu...@apache.org>.
czw., 12 gru 2019 o 06:13 Zahid Rahman <za...@gmail.com> napisał(a):
> So my point is I have not been able to find accurate information , if some
> one could furnish me a Java language specification or recommend  a book
> which accurately describes these I would be grateful.

Start with Gang of Four
http://www.blackwasp.co.uk/gofpatterns.aspx


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org