Skip to main content

Home/ Java Development/ Group items tagged interpreter

Rss Feed Group items tagged

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++).
anonymous

1. Working with Spring Data Repositories - 0 views

  • Typically, your repository interface will extend Repository, CrudRepository or PagingAndSortingRepository. Alternatively, if you do not want to extend Spring Data interfaces, you can also annotate your repository interface with @RepositoryDefinition
  • It allows quick query definition by method names but also custom-tuning of these queries by introducing declared queries as needed.
  • CREATE_IF_NOT_FOUND (default)CREATE_IF_NOT_FOUND combines CREATE and USE_DECLARED_QUERY.
  • ...21 more annotations...
  • the first By acts as delimiter to indicate the start of the actual criteria
  • The mechanism strips the prefixes find…By, read…By, and get…By from the method and starts parsing the rest of it
  • you can define conditions on entity properties and concatenate them with And and Or
  • The introducing clause can contain further expressions such as a Distinct to set a distinct flag
  • List<Person> findByEmailAddressAndLastname(EmailAddress emailAddress, String lastname); // Enables the distinct flag for the query List<Person> findDistinctPeopleByLastnameOrFirstname(String lastname, String firstname); List<Person> findPeopleDistinctByLastnameOrFirstname(String lastname, String firstname); // Enabling ignoring case for an individual property List<Person> findByLastnameIgnoreCase(String lastname); // Enabling ignoring case for all suitable properties List<Person> findByLastnameAndFirstnameAllIgnoreCase(String lastname, String firstname); // Enabling static ORDER BY for a query List<Person> findByLastnameOrderByFirstnameAsc(String lastname); List<Person> findByLastnameOrderByFirstnameDesc(String lastname);
  • You can combine property expressions with AND and OR. You also get support for operators such as Between, LessThan, GreaterThan, Like for the property expressions
  • AllIgnoreCase
  • IgnoreCase
  • The resolution algorithm starts with interpreting the entire part (AddressZipCode) as the property and checks the domain class for a property with that name (uncapitalized). If the algorithm succeeds it uses that property. If not, the algorithm splits up the source at the camel case parts from the right side into a head and a tail and tries to find the corresponding property, in our example, AddressZip and Code.
  • he infrastructure will recognize certain specific types like Pageable and Sort to apply pagination and sorting to your queries dynamically
  • Pageable
  • Sort sort
  • The first method allows you to pass an org.springframework.data.domain.Pageable instance to the query method to dynamically add paging to your statically defined query. Sorting options are handled through the Pageable instance too
  • <repositories base-package="com.acme.repositories" />
  • Spring is instructed to scan com.acme.repositories and all its subpackages for interfaces extending Repository or one of its subinterfaces. For each interface found, the infrastructure registers the persistence technology-specific FactoryBean to create the appropriate proxies that handle invocations of the query methods. Each bean is registered under a bean name that is derived from the interface name, so an interface of UserRepository would be registered under userRepository
  • This postfix defaults to Impl.Example 1.12. Configuration example<repositories base-package="com.acme.repository" /> <repositories base-package="com.acme.repository" repository-impl-postfix="FooBar" />The first configuration example will try to look up a class com.acme.repository.UserRepositoryImpl to act as custom repository implementation, where the second example will try to lookup com.acme.repository.UserRepositoryFoo
  • To exclude an interface that extends Repository from being instantiated as a repository instance, you can either annotate it with @NoRepositoryBean or move it outside of the configured base-package.
  • ]In general, the integration support is enabled by using the @EnableSpringDataWebSupport annotation in your JavaConfig configuration class.
  • @Configuration @EnableWebMvc @EnableSpringDataWebSupport class WebConfiguration { }
  • In case you need multiple Pageables or Sorts to be resolved from the request (for multiple tables, for example) you can use Spring's @Qualifier annotation to distinguish one from another
  • Spring HATEOAS ships with a representation model class PagedResources that allows enrichting the content of a Page instance with the necessary Page metadata as well as links to let the clients easily navigate the pages.
Hendy Irawan

Home - Codehaus - 0 views

  •  
    Janino is a super-small, super-fast Java™ compiler. Not only can it compile a set of source files to a set of class files like the JAVAC tool, but also can it compile a Java™ expression, block, class body or source file in memory, load the bytecode and execute it directly in the same JVM. Janino is not intended to be a development tool, but an embedded compiler for run-time compilation purposes, e.g. expression evaluators or "server pages" engines like JSP. JANINO is integrated with Apache Commons JCI ("Java Compiler Interface") and JBoss Rules / Drools. JANINO can also be used for static code analysis or code manipulation. JANINO can be configured to use the javax.tools.JavaCompiler API (available since JDK 1.6), which removes the Java 5-related limitations.
anonymous

Large scale application development and MVP - Part II - Google Web Toolkit - Google Code - 0 views

  • itself
    • anonymous
       
      The View Implementation
  • @UiHandler("
  • presenter.onAddButtonClicked();
  • ...91 more annotations...
  • onAddButtonClicked
  • eventBus.fireEvent(new AddContactEvent());
  • presenter needs to know more about the view
  • view needs to know more about the data model
  • data types are typically homogeneous within column borders
  • ColumnDefinition abstract class
  • houses the any type-specific code (this is the third party mentioned above)
  • ColumnDefinition
  • ColumnDefinition(s) would be created outside of the presenter
  • we can reuse its logic regardless of what view we've attached ourself to
  • update our views such that we can set their ColumnDefinition(s).
  • setColumnDefinitions
  • this.columnDefinitions = columnDefinitions;
  • so that we can pass in
  • a mocked ContactsView instance when testing our ContactsPresenter
  • in our AppController, when we create the ContactsView,
  • new ContactsViewColumnDefinitions().getColumnDefinitions();
  • we can initialize it with the necessary ColumnDefinition(s).
  • contactsView.setColumnDefiniions(
    • anonymous
       
      Initialize ContactsView with the necessary ColumnDefinition(s)
  • With our ColumnDefinition(s) we can pass the model untouched.
  • As mentioned above we were previously dumbing down the model into a list of Strings
  • current solution
  • List<String> data
  • display.setData(data);
  • how that data type is rendered.
  • use generics
  • third party that abstracts
  • knowledge of a cell's data type
  • stringing together a list of these classes
  • providing the necessary render()
  • and isClickable()/isSelectable() override
  • ContactsViewColumnDefinitions<ContactDetails>
  • columnDefinitions =      new ArrayList<ColumnDefinition<ContactDetails>>()
  • ColumnDefinition<T>
  • ContactsPresenter
  • ContactsViewImpl
  • ColumnDefinition<T> columnDefinition = columnDefinitions.get(j);
  • the presenter can pass the model untouched
  • the view has no rendering code
  • that we would otherwise need to test. And the fun doesn't stop there.
  • presenter.onItemClicked(
  • presenter.onItemSelected
  • ClickEvent
  • cell.getCellIndex()
  • columnDefinition.isClickable()
  • SelectEvent
  • columnDefinition.isSelectable()
  • return shouldFireClickEvent;
  • return shouldFireSelectEvent;
  • respond to user interaction in different ways based upon the cell type that was clicked
  • use them for rendering purposes
  • defining how to interpret user interactions
  • we're going to remove any application state from the ContactsView
  • replace the view's getSelectedRows() with a SelectionModel
  • The SelectionModel is nothing more than a wrapper around a list of model objects.
  • ContactsPresenter holds on to an instance of this class
  • onItemSelected
  • Having the ColumnDefinition create a new widget for each cell is too heavy
  • Replace our FlexTable implementation with an HTML widget
  • calling setHTML()
  • Reduce the event overhead by sinking events on the HTML widget
  • rather than the individual cells
  • update our ContactsView.ui.xml file to use a
  • HTML widget rather than a FlexTable widget.
  • <g:HTML ui:field="contactsTable">
  • Inefficiencies related to inserting new elements via DOM manipulation Overhead associated with sinking events per Widget
  • for each item ask our column definitions to render accordingly
  • each column definition
  • render itself into the StringBuilder
  • rather than passing back a full-on widget
  • calling setHTML on a HTML widget
  • rather than calling setWidget on a FlexTable.
  • This will decrease your load time, especially as your tables start to grow.
  • we're reducing the overhead of sinking events on per-cell widgets
  • instead sinking on a single container
  • ClickEvents are still wired up via our UiHandler annotations
  • get the Element that was clicked on
  • and walk the DOM until we find a parent TableCellElement
  • we can determine the row
  • shouldFirdClickEvent() and shouldFireSelectEvent()
  • to take as a parameter a TableCellElement rather than a HTMLTable.Cell.
  • faster startup times via Code Splitting.
  • runAsync() points
  • split portion of your code is purely segmented
  • not referenced by other parts of the app
  • it will be downloaded and executed at the point that it needs to run
  • Do we really want to download all of that code before the user even logs in?
  • Not really.
  • simply grab the login code, and leave the rest for when we actually need it
  • wrap the code that creates the ContactsView and ContactsPresenter in a runAsync() call
  • as optimizations such as this one become easier and easier to implement.
1 - 7 of 7
Showing 20 items per page