Saturday, October 13, 2018

Spring Cloud

Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems (e.g. configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state). Coordination of distributed systems leads to boiler plate patterns, and using Spring Cloud developers can quickly stand up services and applications that implement those patterns. They will work well in any distributed environment, including the developer's own laptop, bare metal data centres, and managed platforms such as Cloud Foundry.

Spring Cloud focuses on providing good out of box experience for typical use cases and extensible mechanism to cover others.
  • Distributed/versioned configuration
  • Service registration and discovery
  • Routing
  • Service-to-service calls
  • Load balancing
  • Circuit Breakers
  • Global locks
  • Leadership election and cluster state
  • Distributed messaging

References Used :-spring-cloud

Version  :-  1.0.0 

Maven

 Why Maven?

We don’t want to store all the libraries in your project!
You want to tell I need A, B, C and you would want the tool to download the libraries and make them available to you.
That’s Maven. The tool which you use to manage the libraries.
If you need a new version of the library, you can change the version and your project is ready!
Also, You don’t need to worry about what libraries your library needs to work. For example, Spring might need other libaries - logging, xml etc.
Once you declare a dependency on Spring, Maven would download.


But  some  dependencies such as  

       
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc14</artifactId>
            <version>10.2.0.4.0</version>
        </dependency>

                                     we   have  do  add manually . We  can't  download  them  through  maven .




References  Used :- creating-spring-boot-project-with-eclipse-and-maven

Sunday, August 12, 2018

Primfaces Tips

  • When we want to allow only some formatted inputs we can  use mask 
     <p:inputMask  value="#{addNewPatientController.newPatient.contactNum}"  mask="9999999999"  />

  • Primefaces selectonemenu filter 
        <p:selectOneMenu id="advanced" value="#{selectOneMenuView.theme}"   filter="true"
         effect="fade" var="t" style="width:160px"   filterMatchMode="startsWith">

  •  To add progress bar on button click                                                                                                               <p:ajaxStatus onstart="PF('statusDialog').show()" onsuccess="PF('statusDialog').hide()" />                                                                                   <p:dialog widgetVar="statusDialog" modal="true" draggable="false" closable="false"   resizable="false" showHeader="false">
           <p:graphicImage value="/images/processGif.gif"   style="width: 200px;"/>    
              </p:dialog>
  • To get a drop  down  like  this   set  autoWidth  to   autoWidth ="false"                                                                     <p:selectOneMenu id="trxnType" value="#{trxnSummaryController.trxnSummary.txnCode}"      autoWidth ="false">






  • To get  numbers like  this  3, 455, 566 format  we can use                                                                   
                           <h:outputText value="#{trxnSummaryController.summaryObj.totTrxnAll}">    
                                         <f:convertNumber maxFractionDigits="0"  groupingUsed="true" />    
                                </h:outputText>                                                                                                                                                                                    
  • To get  numbers like  this  3, 455, 566.00 format  we can use          
                            <h:outputText value="#{trxnSummaryController.summaryObj.totTrxnAll}">     
                                    <f:convertNumber maxFractionDigits="2"  groupingUsed="true"  pattern="#,##0.00" />
                         </h:outputText>
  • When  adding logic , We unable to  use  '&&'   .We  can  use  'and'  instead  of   '&&' .
                         rendered="#{ (divisionDetailsVar.status != 'TERMINATED')   and   ( ! divisionDetailsVar.isWorkFlowObjActive )  }" 

Version :- 1.2.2

Sunday, July 29, 2018

Tips to Carrier Growth

  •  Spend at least  3,4 hours daily for   self  learning ,side projects .
  •  Do side projects. 
  •  Prepare for interviews .
  •  Always  ask yourself   for reason   for  doing things 
  •  How to Become a Great Developer  









References Used :-     How to Become a Great Self-taught Developer? | Ask a Dev

Monday, July 23, 2018

Spring @Component, @Service, @Repository, @Controller Difference

Spring @Component, @Service, @Repository and @Controller annotations are used for automatic bean detection using classpath scan in Spring framework. @Component is a generic annotation. Difference of @Service, @Repository, @Controller with @Component is they are special cases of @Component and used for particular purposes. The difference is just classification only .

For all these annotations (stereotypes), technically the core purpose is same. Spring automatically scans and identifies all these classes that are annotated with “ @Component, @Service, @Repository, @Controller”  and registers BeanDefinition with ApplicationContext.

  • In a multitier application, we will have different layers like presentation, service, business, data access etc. When a class is to be annotated for auto-detection by Spring, then we should use the respective stereotype as below.
    • @Component – generic and can be used across application.
    • @Service – annotate classes at service layer level.
    • @Controller – annotate classes at presentation layers level, mainly used in Spring MVC.
    • @Repository – annotate classes at persistence layer, which will act as database repository.

Sunday, July 15, 2018

Microservices

Why  Should We  Use  Microservices ? 

#  It makes  our system loosely  coupled .
    If  we  need to repair , upgrade particular microservices  , we don't  have to rebuild  entire    application.
# Microservices  are divide based  on business capabilities ,focusing on  single business capabilities (Not like web microservice , data microservice).
# Microservices  communicate  each other  using  well  defined  interfaces  usually  REST or  Messaging queue .
# Microservices data is  federated also . It owns it  own data model . It  helps  to scaling  purposes  when  particular microservice  has huge  load .
#  Independent development .
#  Independent deployment .
#  We use http  or messaging queue for  communicating  with each  microservices .Most techologies support  http  or messaging queue   . 
#  So we  can use different  technologies for different microservices  .
#  Stateless  -  Each pair of  request and response  communication  makes an  independent  transaction .This gives  effortless scaling capability of  microservices .
# One service should not break due to , broke of another service .
# Granular Scaling .


Characteristics of  Microservices

# Organized on business capabilities
# Products  not projects 
# Decentralized governance 
# Decentralized data management

Referencees Used :-  What are microservices?

Some interesting things to explore more

 Here  some  some  things  to  study  more ,     How Google Search works               https://developers.google.com/search/docs/fundamental...