Modular Java: Creating Flexible Applications with Osgi and Spring (Pragmatic Programmers)

By Craig Walls

Attack complexity on your Java purposes utilizing Modular Java. This pragmatic consultant introduces you to OSGi and Spring Dynamic Modules, of the main compelling frameworks for Java modularization. pushed by way of real-world examples, this e-book will equip you with the knowledge you must boost Java functions which are composed of smaller, loosely coupled, hugely cohesive modules.

the key weapon for attacking complexity in any venture is to wreck it down into smaller, cohesive, and extra simply digestible items. With Modular Java, you could simply advance functions which are extra versatile, testable, maintainable, and comprehensible.

Modular Java is a practical consultant to constructing modular purposes utilizing OSGi, the framework for dynamic modularity in Java, and Spring Dynamic Modules, an OSGi extension to the Spring Framework. you are going to commence with the fundamentals yet speedy ramp up, growing loosely coupled modules that submit and eat providers, and you may see the way to compose them into better functions. alongside the way in which, you are going to practice what you examine as you construct an entire net program that's made of numerous OSGi modules, utilizing Spring-DM to cord these modules together.

Modular Java is stuffed with advice and tips that may make you a more adept OSGi and Spring-DM developer. outfitted with the information won from this publication, you possibly can enhance purposes which are extra powerful and agile.

Show description

Preview of Modular Java: Creating Flexible Applications with Osgi and Spring (Pragmatic Programmers) PDF

Best Development books

Introduction to Programming Using Python plus MyProgrammingLab with Pearson eText -- Access Card

Observe: ahead of procuring, seek advice from your teacher to make sure you decide upon the proper ISBN. numerous models of Pearson's MyLab & learning items exist for every identify, and registrations should not transferable. To sign up for and use Pearson's MyLab & getting to know items, it's also possible to want a direction identity, which your teacher will offer.

Ground Control: Fear and Happiness in the Twenty-First-Century City

Whilst the figures say crime is falling, why are we extra worried than ever? might our cities and towns be developing worry and distrust? extra estate is being in-built Britain than at any time because the moment global battle - yet it truly is owned by way of inner most agencies, designed for revenue and watched over through CCTV.

The Dragon's Gift: The Real Story of China in Africa

Is China a rogue donor, as a few media pundits recommend? Or is China assisting the constructing international pave a pathway out of poverty, because the chinese language declare? within the previous few years, China's reduction application has leapt out of the shadows. Media reviews approximately large reduction applications, help for pariah regimes, regiments of chinese language exertions, and the ruthless exploitation of staff and common assets in the various poorest nations on the planet sparked fierce debates.

The Coming Prosperity: How Entrepreneurs Are Transforming the Global Economy

Ours is the main dynamic period in human background. some great benefits of 4 centuries of technological and organizational switch are finally attaining a formerly excluded worldwide majority. this variation will create large-scale possibilities in richer international locations just like the usa simply because it has in poorer nations now within the ascent.

Additional info for Modular Java: Creating Flexible Applications with Osgi and Spring (Pragmatic Programmers)

Show sample text content

Logging. pax-logging-service_1. three. zero com. dudewheresmyjar. domain_1. zero. zero. image org. compass-project. compass_2. 1. 1 com. dudewheresmyjar. index_1. zero. zero. photo ninety T ESTING THE S ERVICE Woo-hoo! As you will discover, all of our bundles are lively. yet used to be the index provider released? Let’s use the package deal command in Equinox to determine: osgi> package 7 initial@reference:file:com. dudewheresmyjar. index_1. zero. zero. image. jar/ [7] Id=7, Status=ACTIVE information Root=/Users/wallsc/Projects/projects/dwmj/runner/ equinox/org. eclipse. osgi/bundles/7/data Registered prone {dwmj. index. IndexService}={service. id=24} No providers in use. Exported applications dwmj. index; version="1. zero. zero. SNAPSHOT"[exported] Imported programs dwmj. area; version="1. zero. zero. SNAPSHOT" org. compass. middle; version="0. zero. 0" org. compass. middle. config; version="0. zero. 0" org. osgi. framework; version="1. four. 0" No fragment bundles Named type area com. dudewheresmyjar. index; bundle-version="1. zero. zero. SNAPSHOT"[provided] No required bundles osgi> And there you could have it! less than the Registered companies header, we discover carrier has, in reality, been registered with the totally certified identify of the IndexService interface. The index provider is open for company. Later during this bankruptcy, we’re going to construct the spider package deal, a package that may devour the index carrier. And later, we’ll construct the internet entrance finish of the appliance that would use the index provider to look for artifacts. yet first, let’s write an integration try to force the index carrier and assert that it does what we'd like it to do. five. 2 trying out the provider whilst trying out the index carrier, shall we (and might be should still) write a unit try out opposed to IndexServiceImpl that mocks the Compass item given to the undefined. yet that kind of try out could in simple terms be capable to make certain that IndexServiceImpl interacts with Compass within the manner that we predict it's going to. It doesn't assert that these interactions accomplish the performance that we hope from the index carrier. ninety one T ESTING THE S ERVICE Pax examination vs. Spring-DM’s trying out aid I may still point out that Pax examination isn’t the single solution to try out OSGi bundles inside an OSGi framework. Spring-DM additionally comes with bundle-level checking out aid that's conceptually similar to what Pax examination deals. in reality, it may be argued that Spring-DM’s trying out aid is best than Pax examination since it takes benefit of Spring autowiring to dispose of the necessity to search for companies from the OSGi carrier registry. even supposing autowiring of providers into checks is unquestionably a pleasant factor to have, Spring-DM’s checking out help relies on JUnit three, which (in my opinion) makes it awkward to paintings with. SpringDM has slated help for JUnit four (and TestNG) in model 2. zero. zero. yet until eventually then, I’ll take Pax Exam’s JUnit 4–style assessments over SpringDM’s autowiring of companies.

Download PDF sample

Rated 4.41 of 5 – based on 3 votes