// Path: modularity-demo/provider/src/provider/MessageProvider.java
// public interface MessageProvider {
//     String getMessage();
// }
// 
// Path: modularity-demo/renderer/src/renderer/MessageRenderer.java
// public interface MessageRenderer {
//     void render();
//     void setMessageProvider(MessageProvider provider);
//     MessageProvider getMessageProvider();
// }


import java.util.Iterator;
import java.util.ServiceLoader;
import provider.MessageProvider;
import renderer.MessageRenderer;

package client;


//import provider.impl.HelloWorldMessageProvider;
//import renderer.impl.StandardOutMessageRenderer;

public class HelloModularityClient {

    public static void main(String[] args) {
//      MessageProvider provider = new MessageProvider();
    	ServiceLoader<MessageProvider> loaderProvider = ServiceLoader.load(MessageProvider.class);
    	Iterator<MessageProvider> iterProvider = loaderProvider.iterator();
	    if (!iterProvider.hasNext()) throw new RuntimeException("No MessageProvider providers found!");
	    MessageProvider provider = iterProvider.next();

//	    MessageRenderer renderer = new StandardOutMessageRenderer();

// Path: modularity-demo/provider/src/provider/MessageProvider.java
// public interface MessageProvider {
//     String getMessage();
// }
// 
// Path: modularity-demo/renderer/src/renderer/MessageRenderer.java
// public interface MessageRenderer {
//     void render();
//     void setMessageProvider(MessageProvider provider);
//     MessageProvider getMessageProvider();
// }


// Path: modularity-demo/client/src/client/HelloModularityClient.java
import java.util.Iterator;
import java.util.ServiceLoader;
import provider.MessageProvider;
import renderer.MessageRenderer;

package client;


//import provider.impl.HelloWorldMessageProvider;
//import renderer.impl.StandardOutMessageRenderer;

public class HelloModularityClient {

    public static void main(String[] args) {
//      MessageProvider provider = new MessageProvider();
    	ServiceLoader<MessageProvider> loaderProvider = ServiceLoader.load(MessageProvider.class);
    	Iterator<MessageProvider> iterProvider = loaderProvider.iterator();
	    if (!iterProvider.hasNext()) throw new RuntimeException("No MessageProvider providers found!");
	    MessageProvider provider = iterProvider.next();

//	    MessageRenderer renderer = new StandardOutMessageRenderer();

	    ServiceLoader<MessageRenderer> loaderRenderer = ServiceLoader.load(MessageRenderer.class);
