Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF meta-model design to handleimages
EMF meta-model design to handleimages [message #768463] Tue, 20 December 2011 07:59 Go to next message
Elvis Dowson is currently offline Elvis DowsonFriend
Messages: 65
Registered: December 2011
Member
Hi,
I was to enhance my EMF meta-model to handle images. I need to persist my model to both an XML file, and later on, to a SQL database.

How can I do about doing this and what considerations should I keep in mind?

Elvis
Re: EMF meta-model design to handleimages [message #768473 is a reply to message #768463] Tue, 20 December 2011 08:11 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Elvis,

I suppose you'll want to encode the image in some type of textual format
such as base64 or hex. You can do that with an EDataType and then
specializing the generated factory to do the to and from string
conversion. You can use XMLTypeFactory to reuse the base64 conversion
or the EByteArray support in EcoreFactory.


On 20/12/2011 8:59 AM, Elvis Dowson wrote:
> Hi,
> I was to enhance my EMF meta-model to handle images. I need to
> persist my model to both an XML file, and later on, to a SQL database.
>
> How can I do about doing this and what considerations should I keep in
> mind?
>
> Elvis


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF meta-model design to handleimages [message #768482 is a reply to message #768473] Tue, 20 December 2011 08:28 Go to previous messageGo to next message
Elvis Dowson is currently offline Elvis DowsonFriend
Messages: 65
Registered: December 2011
Member
Hi Ed,
What about storing references to

a. Binary image files stored locally on the file system

b. BLOB data stored within a database

Elvis
Re: EMF meta-model design to handleimages [message #768491 is a reply to message #768482] Tue, 20 December 2011 08:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Elvis,

Comments below.

On 20/12/2011 9:29 AM, Elvis Dowson wrote:
> Hi Ed,
> What about storing references to
> a. Binary image files stored locally on the file system
That doesn't sound portable though. Of course you could use a URI with
an http address and have the images on the web. You model would just
have URIs and you'd use that value to load an image.
>
> b. BLOB data stored within a database
A blob is just like a byte array, right? So if you have a data type
like byte[] you could use the value directly for the blob. (I'm
assuming you can create an image from bytes and convert an image to bytes.)
>
> Elvis


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF meta-model design to handleimages [message #768554 is a reply to message #768491] Tue, 20 December 2011 11:01 Go to previous messageGo to next message
Elvis Dowson is currently offline Elvis DowsonFriend
Messages: 65
Registered: December 2011
Member
Hi Ed,
Is there an Ecore class specifically designed to handle URI's?

Elvis
Re: EMF meta-model design to handleimages [message #768568 is a reply to message #768554] Tue, 20 December 2011 11:42 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Elvis,

No, but you can just use string and convert that to a URI or URL as needed.


On 20/12/2011 12:01 PM, Elvis Dowson wrote:
> Hi Ed,
> Is there an Ecore class specifically designed to handle URI's?
>
> Elvis


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] Multiple (interface) inheritance issues
Next Topic:[CDO]
Goto Forum:
  


Current Time: Thu Mar 28 21:37:04 GMT 2024

Powered by FUDForum. Page generated in 0.04106 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top