This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Wednesday, February 13, 2013

Spring Example - Spring Framework - Spring Tutorial - A Simple Example in Spring

Spring Example:

  
 The Spring Framework represents a dependency injection / inversion of control container framework for the Java platform. Furthermore Spring offers a lot of additional functions.Spring framework was initially.
                                   Written by Rod Johnson and was first released under the Apache 2.0 license in June 2003.

Use Case:

Test Class             -      To create a main class in eclips.
Triangle Class       -      To create getter and setter in Triangle class.
Point Class            -      To create a point set the value.
Spring Class          -      To create a beans

Test Java class:

package Tutorial;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Test
{
      public static void main(String[] args)
       {
              ApplicationContext aap=new ClassPathXmlApplicationContext("spring.xml");
              Triangle t=(Triangle)aap.getBean("tri");
              t.draw();
       }
}

Triangle class in Java:

package Tutorial;

import java.util.List;

public class Triangle
{
      
       Point point1;
       Point point2;
       Point point3;
      
public Point getPoint1() {
              return point1;
       }


       public void setPoint1(Point point1) {
              this.point1 = point1;
       }

       public Point getPoint2() {
              return point2;
       }

       public void setPoint2(Point point2) {
              this.point2 = point2;
       }

       public Point getPoint3() {
              return point3;
       }

       public void setPoint3(Point point3) {
              this.point3 = point3;
       }

public void draw()
{
      
      
       System.out.println("point1" + point1.getX()+"\tpoint2" + point1.getY());
}
}

Point Class in Java:

package Tutorial;

public class Point {
 int x;
 int y;
public int getX() {
       return x;
}
public void setX(int x) {
       this.x = x;
}
public int getY() {
       return y;
}
public void setY(int y) {
       this.y = y;
}  
}

Spring Class in Xml:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd" >

<beans>
<bean id="tri" class="Tutorial.Triangle" autowire="constructor" >
  
</bean>  

 <bean id="tri1" class="Tutorial.Point" >
 <property name="x" value="10"/>
 <property name="y" value="20"/>
 </bean>
 
</beans>     

Spring Framework - Introduction of Spring - Spring - Documentation of Spring

Spring Framework:

                                                   The Spring Framework provides a comprehensive programming and configuration model for modern Java-based enterprise applications - on any kind of deployment platform. The Spring Framework is an open source application framework and inversion of control container for the Java platform.
                                                                                                                        Spring is not necessarily one more framework dependency for your project. Spring is potentially a one-stop shop, addressing most infrastructure concerns of typical applications. It also goes places other frameworks don't.
Spring.NET provides comprehensive infrastructural support for developing enterprise .NET applications.  It allows you to remove incidental complexity when using the base class libraries makes best practices, such as test driven development, easy practices.  Spring.NET is created, supported and sustained by SpringSource. The breath of functionality in Spring .NET spans application tiers which allows you to treat it as a ‘one stop shop’ but that is not required.  Spring .NET is not an all-or-nothing solution.  You can use the functionality in its modules independently.


Spring includes:

·         Flexible dependency injection with XML and annotation-based configuration styles
·         Advanced support for aspect-oriented programming with proxy-based and AspectJ-based variants
·         Support for declarative transactions, declarative caching, declarative validation, and declarative formatting
·         Powerful abstractions for working with common Java EE specifications such as JDBC, JPA, JTA and JMS
·         First-class support for common open source frameworks such as Hibernate and Quartz
·         A flexible web framework for building RESTful MVC applications and service endpoints
·         Rich testing facilities for unit tests as well as for integration tests

SPRING SECURITY

Spring Security is a powerful and highly customizable authentication and access-control framework. It is the de-facto standard for securing Spring-based applications.
Spring Security is one of the most mature and widely used Spring projects. Founded in 2003 and actively maintained by SpringSource since, today it is used to secure numerous demanding environments including government agencies, military applications and central banks. It is released under an Apache 2.0 license so you can confidently use it in your projects.
The Spring Framework serves as the foundation for the wider family of Spring open source projects, including:
·         Spring Security
·         Spring Integration
·         Spring Batch
·         Spring Data
·         Spring Web Flow
·         Spring Web Services
·         Spring Mobile
·         Spring Social
·         Spring Android


Aspect-oriented programming framework:

The Spring Framework has its own AOP framework which modularizes cross-cutting concerns in aspects. The motivation for creating a separate AOP framework comes from the belief that it would be possible to provide basic AOP features without too much complexity in either design, implementation, or configuration. The Spring AOP framework also takes full advantage of the Spring container.


Operators in C and C++ - C++ Operators - Operators C++ - Implementation of C++ operators

C AND C++ Operators:

An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. This is a list of operators in the C and C++ programming languages. All the operators listed exist in C++; the fourth column "Included in C", dictates whether an operator is also present in C. Note that C does not support operator overloading.
                                                             C++ defines keywords to act as aliases for a number of operators. and (&&), bitand (&), and_eq (&=), or (||), bitor (|), or_eq (|=), xor (^), xor_eq (^=), not (!), not_eq (!=), compl (~). These can be used exactly the same way as the symbols they replace as they are not the same operator under a different name, but rather simple text aliases for the name (character string) of respective operator.

Types of Operators
                               1. Arithmetic Operators
                                2. Relational Operators
                                3.Logical Operators
                                4.Bitwise Operators
                                5.Assignment Operators
                               

1.Arithmatic Operators:
                                     Operations of addition, subtraction, multiplication and division literally correspond with their respective mathematical operators. The only one that you might not be so used to see is modulo; whose operator is the percentage sign (%).

OperatorDescriptionExample
+Adds two operandsA + B will give 30
-Subtracts second operand from the firstA - B will give -10
*Multiply both operandsA * B will give 200
/Divide numerator by de-numeratorB / A will give 2
%Modulus Operator and remainder of after an integer divisionB % A will give 0
++Increment operatorA++ will give 11
--Decrement operatoA-- will give 9

2.Relational Operators:
In order to evaluate a comparison between two expressions we can use the relational and equality operators. The result of a relational operation is a Boolean value that can only be true or false.Acording to its Boolean result. 
OperatorDescriptionExample
==Equal(A == B) is not true.
!=Not Equal(A != B) is true.
>Grater Than(A > B) is not true.
<Less Than(A < B) is true.
>=Grater Than(A >= B) is not true.
<=Less Than(A <= B) is true.

3.Logical Operators:
                                  The Operator ! is the C++ operator to perform the Boolean operation NOT, it has only one operand, located at its right, and the only thing that it does is to inverse the value of it, producing false if its operand is true and true if its operand is false.

    Operators                                             Meaning
       &&                                                       AND
       ||                                                         OR
         !                                                         NOT

4.Bitwise Operator:
                                  Bitwise operators modify variables considering the bit patterns that represent the values they store.
operator
asm equivalent
description
&
AND
Bitwise AND
|
OR
Bitwise Inclusive OR
^
XOR
Bitwise Exclusive OR
~
NOT
Unary complement (bit inversion)
<< 
SHL
Shift Left
>> 
SHR
Shift Right

5.Arithmatic Operators:

                                          Operations of addition, subtraction, multiplication and division literally correspond with their respective mathematical operators.
+
addition
-
subtraction
*
multiplication
/
division
modulo.

A simple program in operator:


#include<conio.h>
#include<stdio.h>

void main()
{

int a b;
clrscr();
printf("Enter the value of a=");
scanf("%d",&a);

printf("Enter the value of b=");
scanf("%d",&b);
if(a>b)
printf("a is grater");
else
printf("b is grater");
getch();
}