Skip to main content

Home/ Java Development/ Group items tagged Object

Rss Feed Group items tagged

Hendy Irawan

jMock - An Expressive Mock Object Library for Java - 3 views

  •  
    JMock is a library that supports test-driven development1 of Java2 code with mock objects3. Mock objects help you design and test the interactions between the objects in your programs.
  •  
    "JMock is a library that supports test-driven development of Java code with mock objects. Mock objects help you design and test the interactions between the objects in your programs. The jMock library: makes it quick and easy to define mock objects, so you don't break the rhythm of programming. lets you precisely specify the interactions between your objects, reducing the brittleness of your tests. works well with the autocompletion and refactoring features of your IDE plugs into your favourite test framework is easy to extend."
Hendy Irawan

XStream - a simple library to serialize objects to XML and back again. - 0 views

  •  
    XStream is a simple library to serialize objects to XML and back again. Features Ease of use. A high level facade is supplied that simplifies common use cases. No mappings required. Most objects can be serialized without need for specifying mappings. Performance. Speed and low memory footprint are a crucial part of the design, making it suitable for large object graphs or systems with high message throughput. Clean XML. No information is duplicated that can be obtained via reflection. This results in XML that is easier to read for humans and more compact than native Java serialization. Requires no modifications to objects. Serializes internal fields, including private and final. Supports non-public and inner classes. Classes are not required to have default constructor. Full object graph support. Duplicate references encountered in the object-model will be maintained. Supports circular references. Integrates with other XML APIs. By implementing an interface, XStream can serialize directly to/from any tree structure (not just XML). Customizable conversion strategies. Strategies can be registered allowing customization of how particular types are represented as XML. Error messages. When an exception occurs due to malformed XML, detailed diagnostics are provided to help isolate and fix the problem. Alternative output format. The modular design allows other output formats. XStream ships currently with JSON support and morphing.
Paul Sydney Orozco

http://www.adobocode.com/spring/marshallingunmarshalling-java-objects-into-xml-file-usi... - 0 views

  •  
    The release 3.0 of Spring Framework added the Spring Module OXM which supports the marshalling and unmarshalling of Java objects and XML documents.In this post, we will be using Spring OXM to take a Java object, convert it to a XML-format and save it in the hard-disk as an XML file containing information of that Java object. We will also cover how to retrieve back the serialized state of that XML file and reconstruct it back to it's original state as a Java object.
mahesh 1234

Object Class, Object Class in Java, Object Class Methods, Object Class Tutorial - Javat... - 0 views

  •  
    Advantage of OOPs Naming Convention Object and Class Method Overloading Constructor static keyword this keyword Inheritance(IS-A) Aggregation(HAS-A) Method Overriding Covariant Return Type super keyword Instance Initializer block final keyword Runtime Polymorphism Dynamic Binding instanceof operator Abstract class Interface Package Access Modifiers Encapsulation Object class Object Cloning Java Array Call By Value strictfp keyword API Document Command Line Arg
Hendy Irawan

EasyMock - Mock Objects for interfaces & objects by generating them on the fly using Ja... - 10 views

  •  
    "EasyMock provides Mock Objects for interfaces (and objects through the class extension) by generating them on the fly using Java's proxy mechanism. Due to EasyMock's unique style of recording expectations, most refactorings will not affect the Mock Objects. So EasyMock is a perfect fit for Test-Driven Development. EasyMock is open source software available under the terms of the Apache 2.0 license. Development, downloads and issue tracking are hosted on SourceForge. "
mahesh 1234

Object Class in Java - javatpoint - 0 views

  •  
    In this page, we will learn about the objects and classes. In object-oriented programming, we design a program using objects and classes. Object is the physical entity whereas class is the logical entity. A class works as a template from which we create the objects.
anonymous

Getting Started with RequestFactory - Google Web Toolkit - Google Code - 0 views

  • Entity Proxies
    • anonymous
       
      Proxy type (on the Client) vs Entity type (on the server)
  • proxy types
  • entity types
  • ...147 more annotations...
  • methods that return service stubs
  • one RequestFactory interface for your application
  • employeeRequest();
  • @Service(Employee.class)
  • extends RequestContext
  • extends RequestFactory
  • service stub
  • RequestFactory service stubs
  • must extend RequestContext
  • The methods in a service stub do not return entities directly
  • return subclasses of com.google.gwt.requestfactory.shared.Request.
  • This allows the methods on the interface to be invoked asynchronously with
  • Request.fire()
  • fire(    new Receiver()
  • onSuccess
  • callers pass an AsyncCallback that implements onSuccess()
  • takes a Receiver which must implement onSuccess()
  • Receiver is an abstract class having a default implementation of onFailure()
  • you can extend Receiver and override onFailure()
  • onViolation()
  • any constraint violations on the server
  • The Request type returned from each method
  • parameterized with the return type of the service method.
  • Methods that have no return value should return type Request<Void>
  • BigDecimal, BigInteger, Boolean, Byte, Enum, Character, Date, Double, Float, Integer, Long, Short, String, Void
  • subclass of EntityProxy
  • List<T> or Set<T>
  • primitive types are not supported
  • methods that operate on an entity itself
  • like persist() and remove()
  • return objects of type InstanceRequest rather than Reques
  • Server Implementations
  • methods defined in an
  • entity's service interface
  • implemented in the class named
  • @Service annotation
  • in these examples, is the entity class
  • service implementations do not directly implement the RequestContext interface
  • server-side implementations use the domain entity types
  • @Entity
  • EntityManager
  • createQuery
  • getResultList();
  • entityManager()
  • createEntityManager()
  • em.persist(this);
  • em.remove(attached
  • em.close();
  • defined in the service's
  • RequestContext interface
  • even though the implementation does not formally implement the interface in Java
  • name and argument list for each method
  • same on client and server
  • Client side methods
  • return Request<T>
  • only T on the server
  • EntityProxy types become the domain entity type on the server
  • Methods that return a Request object in the client interface are implemented as static methods on the entity
  • Methods that operate on a single instance of an entity, like persist() and remove(),
  • eturn an
  • InstanceRequest
  • in the client interface
  • Instance methods do not pass the instance directly, but rather via the
  • using()
  • instance methods must be implemented as non-static methods in the entity type
  • Four special methods are required on all entities
  • as they are used by the RequestFactory servlet:
  • constructor
  • findEntity
  • An entity's getId()
  • is typically auto-generated by the persistence engine (JDO, JPA, Objectify, etc.)
  • "find by ID" method has a special naming convention
  • find()
  • "find" plus the type's simple name
  • On the server
  • getVersion() method is used by RequestFactory to infer if an entity has changed
  • backing store (JDO, JPA, etc.) is responsible for updating the version each time the object is persisted,
  • RequestFactoryServlet sends an UPDATE
  • if an entity changes as
  • Second, the client maintains a version cache of recently seen entities
  • Whenever it sees an entity whose version has changed, it fires
  • UPDATE events on the event bus
  • so that listeners can update the view
  • GWT.create
  • and initialize it with your application's EventBus
  • GWT.create
  • requestFactory.initialize
  • create a new entity on the client
  • EmployeeRequest request
  • EmployeeProxy newEmployee
  • All client-side code should use the EmployeeProxy
  • not the Employee entity itself
  • unlike GWT-RPC, where the same concrete type is used on both client and server
  • RequestFactory
  • designed to be used with an ORM layer like JDO or JPA
  • on the server
  • to build data-oriented (CRUD) apps with an ORM-like interface
  • on the client
  • easy to implement a data access layer
  • structure your server-side code in a data-centric way
  • GWT-RPC, which is service-oriented
  • On the client side, RequestFactory keeps track of objects that have been modified and sends only changes
  • lightweight network payloads
  • solid foundation for automatic batching and caching of requests in the future
  • RequestFactoryServlet
  • RequestFactory uses its own servlet
  • own protocol
  • not designed for general purpose services like GWT-RPC
  • implements its
  • It is designed specifically for implementing a persistence layer on both client and server.
  • In persistence frameworks like JDO and JPA, entities are annotated with
  • client-side representation of an entity
  • known as a
  • DTO (Data Transfer Object)
  • hook used to indicate that an object can be managed by RequestFactory
  • RequestFactory
  • EntityProxy interface
  • automatically populates bean-style properties between entities on the server and the corresponding EntityProxy on the client,
  • send only changes ("deltas") to the server
  • extends EntityProxy
  • interface
  • @ProxyFor
  • reference the server-side entity being represented
  • It is not necessary to represent every property and method from the server-side entity in the EntityProxy
  • EntityProxyId returned by this method is used throughout RequestFactory-related classes
  • while getId() is shown in this example, most client code will want to refer to
  • EntityProxy.stableId() i
  • to represent any type
  • is not required to expose an ID and version
  • often used to represent embedded object types within entities
  • @Embedded
  • Address
  • Address type
  • POJO with no persistence annotations
  • Address is represented as a ValueProxy
  • extends ValueProxy
  • interface
  • extends EntityProxy
  • interface
  • AddressProxy
  • AddressProxy
  • ValueProxy can be used to pass any type to and from the server
  • RequestFactory
  • interface between your client and server code
  • RequestContext interface
  • The server-side service
  • must implement each method
Hendy Irawan

6. Validation, Data Binding, and Type Conversion - Spring Framework - 0 views

  •  
    "There are pros and cons for considering validation as business logic, and Spring offers a design for validation (and data binding) that does not exclude either one of them. Specifically validation should not be tied to the web tier, should be easy to localize and it should be possible to plug in any validator available. Considering the above, Spring has come up with a Validator interface that is both basic ands eminently usable in every layer of an application. Data binding is useful for allowing user input to be dynamically bound to the domain model of an application (or whatever objects you use to process user input). Spring provides the so-called DataBinder to do exactly that. The Validator and the DataBinder make up the validation package, which is primarily used in but not limited to the MVC framework. The BeanWrapper is a fundamental concept in the Spring Framework and is used in a lot of places. However, you probably will not have the need to use the BeanWrapper directly. Because this is reference documentation however, we felt that some explanation might be in order. We will explain the BeanWrapper in this chapter since, if you were going to use it at all, you would most likely do so when trying to bind data to objects. Spring's DataBinder and the lower-level BeanWrapper both use PropertyEditors to parse and format property values. The PropertyEditor concept is part of the JavaBeans specification, and is also explained in this chapter. Spring 3 introduces a "core.convert" package that provides a general type conversion facility, as well as a higher-level "format" package for formatting UI field values. These new packages may be used as simpler alternatives to PropertyEditors, and will also be discussed in this chapter."
Hendy Irawan

Super Csv - A free CSV reader/writer... - 0 views

  •  
    best, fastest and most programmer friendly free CSV package for Java. Super Csv's unique features raises the bar and sets a new standard for CSV packages. Super Csv is designed around solid Object-oriented principles, and thus aims to leverage your Object-oriented code, making it easier to write and maintain.
Merit Campus

Java Training - InterThread Communication - 0 views

  •  
    Inter Thread Communication is one of the distinct facility in multi threading application development of java. In real world Inter Thread communication based applications of java works faster when compared to all the other applications in java. Inter-thread communication is all about making synchronized threads communicate with each other. It is a mechanism in which a thread is paused running in its critical section and another thread is allowed to enter in the same critical section to be executed. It is implemented by following methods of Object class wait() : Tells the calling thread to give up monitor and go to sleep until some other thread enters the same monitor and call notify. Causes current thread to release the lock and wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed. The current thread must own this object's monitor.
mahesh 1234

Command Line Argument, Command Line Argument in Java, Tutorial, Example - Javatpoint - 0 views

  •  
    Advantage of OOPs Naming Convention Object and Class Method Overloading Constructor static keyword this keyword Inheritance(IS-A) Aggregation(HAS-A) Method Overriding Covariant Return Type super keyword Instance Initializer block final keyword Runtime Polymorphism Dynamic Binding instanceof operator Abstract class Interface Package Access Modifiers Encapsulation Object class Object Cloning Java Array Call By Value strictfp keyword API Document Command Line Arg
mahesh 1234

Creating Api Document, Api Document, Creating Api Document Tutorial, Example - Javatpoint - 0 views

  •  
    Advantage of OOPs Naming Convention Object and Class Method Overloading Constructor static keyword this keyword Inheritance(IS-A) Aggregation(HAS-A) Method Overriding Covariant Return Type super keyword Instance Initializer block final keyword Runtime Polymorphism Dynamic Binding instanceof operator Abstract class Interface Package Access Modifiers Encapsulation Object class Object Cloning Java Array Call By Value strictfp keyword API Document Command Line Arg
mahesh 1234

Strictfp Keyword, Strictfp in Java, Strictfp Keyword Tutorial - Javatpoint - 0 views

  •  
    Advantage of OOPs Naming Convention Object and Class Method Overloading Constructor static keyword this keyword Inheritance(IS-A) Aggregation(HAS-A) Method Overriding Covariant Return Type super keyword Instance Initializer block final keyword Runtime Polymorphism Dynamic Binding instanceof operator Abstract class Interface Package Access Modifiers Encapsulation Object class Object Cloning Java Array Call By Value strictfp keyword API Document Command Line Arg
mahesh 1234

History of Java, Java History, History of Java Programming, Java Version History - Java... - 0 views

  •  
    Advantage of OOPs Naming Convention Object and Class Method Overloading Constructor static keyword this keyword Inheritance(IS-A) Aggregation(HAS-A) Method Overriding Covariant Return Type super keyword Instance Initializer block final keyword Runtime Polymorphism Dynamic Binding instanceof operator Abstract class Interface Package Access Modifiers Encapsulation Object class Object Cloning Java Array Call By Value strictfp keyword API Document Command Line Arg
mahesh 1234

Constructor in Java- Javatpoint - 0 views

  •  
    Constructor is a special type of method that is used to initialize the object. Constructor is invoked at the time of object creation. It constructs the values i.e. provides data for the object that is why it is known as constructor. Rules for creating constructor There are basically two rules defined for the constructor.
abuwipp

ResultSet (Java 2 Platform SE 5.0) - 0 views

  • to insert column values into the insert row. An updatable ResultSet object has a special row associated with it that serves as a staging area for building a row to be inserted. The following code fragment moves the cursor to the insert row, builds a three-column row, and inserts it into rs and into the data source table using the method insertRow
  • moveToInsertRow
  • updateString
  • ...1 more annotation...
  • insertRow
  •  
    to insert column values into the insert row. An updatable ResultSet object has a special row associated with it that serves as a staging area for building a row to be inserted. The following code fragment moves the cursor to the insert row, builds a three-column row, and inserts it into rs and into the data source table using the method insertRow.
DJHell .

Evolutionary architecture and emergent design: Emergent design through metrics - 4 views

  •  
    Some of the common questions relating to cyclomatic complexity are "How does my code compare to others?" and "What is a good number for a particular class?" The iPlasma project answers these questions (see Resources). iPlasma is a platform, created as a university project in Romania, for quality assessment of object-oriented design. It generates a pyramid, showing key metrics for your project along with comparisons to industry-standard ranges for those numbers.
Javin Paul

Class Variable vs Instance Variable in Java - 0 views

  •  
    Quick guide on class, instance and local variable in Java. major difference between all these three variable is there scope and how do you access it. class variable belongs to class, instance belongs to Object and local variable belongs to local code block.
mahesh 1234

Java OOPs Concepts - 0 views

  •  
    OOPs (Object-Oriented Programming). Java is an object oriented programming language. Let's see the concepts of oops.
mahesh 1234

Features of Java - 0 views

  •  
    There is given many features of java. They are also called java buzzwords. 1.Simple 2.Object-oriented 3.Platform independent 4.Secured 5.Robust 6.Architecture neutral 7.Portable 8.Dynamic 9.Interpreted 10.High Performance 11.Multithreaded 12.Distributed Simple Java is simple in the sense that: syntax is based on C++ (so easier for programmers to learn it after C++).
  •  
    There is given many features of java. They are also called java buzzwords. 1.Simple 2.Object-oriented 3.Platform independent 4.Secured 5.Robust 6.Architecture neutral 7.Portable 8.Dynamic 9.Interpreted 10.High Performance 11.Multithreaded 12.Distributed Simple Java is simple in the sense that: syntax is based on C++ (so easier for programmers to learn it after C++).
1 - 20 of 48 Next › Last »
Showing 20 items per page