Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement a "remote" Domain?

Imagine two Grails applications which share a domain class. Maybe a Book domain class.

One application is identified as the owner of the data, one will have to access the domain data. Something like amazon and the amazon web services.

I guess it is trivial that the owning application will use a normal domain class and will expose the data through web services - no problem in grails.

But what would be best practice to implement the domain in the other application?

  • use a service to access the remote domain and not implement a local domain class at all?
  • implement a local domain class, overwrite the get()-method in order to fetch the remote data and use the local database as cache?
  • what other solution comes to your mind?
like image 954
rdmueller Avatar asked May 16 '12 07:05

rdmueller


People also ask

What is a remote domain?

What is a “Remote Domain”? Remote Domains are an organizational setting that allow you to control certain message types such as “Out of Office” and “Non-Delivery Reports”. In an Exchange Hybrid environment, they are configured independently in both the on-premises and Exchange Online organization.

What is remote domain and accepted domain?

In the case of receiving email, accepted domains also include those SMTP namespaces for which Exchange will receive a message yet continue to send it onwards to other external email systems. Remote domains are simply those SMTP namespaces that are external to Exchange.

How do I add a remote domain in Exchange 2016?

To configure remote domains, log in to the Exchange Admin Center, and go to Mail Flow > Remote Domains. To add a remote domain, click the Add icon, and then type a display name and the domain. In addition to individual subdomains, admins can also use wildcard characters.


1 Answers

Ryan Geyer has a very interesting article Modularizing your Grails application domain classes which lists 3 solutions to this problem:

  1. As a RESTful JSON Service - easy to get this setup in Grails but then you lose the automatic GORM functionality.

  2. Separate out the domain classes into a library JAR file and reference that library in both of my other applications. This is not as easy as it first sounds

  3. Create a Grails plugin. Put the domain object in the plugin. Each of your applications can then import this plugin. You can then create different controllers with different functionality as required. The sample code for this is available at:

    git clone git://ec2.nslms.com/grails/blog_example_modular

Ted Naleid gives a great tip later in the post and recommends...

"create a grails-app/conf/BuildConfig.groovy file and put the plugin name and path to the source in it. ... If you do this, your applications will see the live changes to your domain/controller/service/etc classes as if they were actually in current app and there isn't any need to repackage and reinstall the plugin when you make changes."

Using memcache should enable both applications to have a consistent view of the data and would avoid each individual application having it's own inconsistent cache.

like image 184
Chris Avatar answered Oct 19 '22 09:10

Chris