(no subject)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

(no subject)

Johan Brichau-2
I will be there!
Looking forward to meet you all.

Johan

On 07 Sep 2010, at 20:07, Dale Henrichs <[hidden email]> wrote:

> Just out of curiousity, who will be making it to ESUG this year?
>
> We should try to grab a GLASS lunch table together on at least one of the days so we can swap war stories face to face ... although perhaps it would be more familiar to sit at separate tables and send email back and forth:)
>
> Dale

Reply | Threaded
Open this post in threaded view
|

A few other questions about GemStone

FDominicus
Ok, I'm working towards a better understanding of GemStone. I still have
a few problems adopting to the OO approach in GemStone well and how to
get data from RDBS into GemStone.

First question:
I read about GemConnect, but it seems this is just "suitable" for Oracle
DB. Well how do I get access to other RDB in a way to "migrate" Data to
GemStone?

Second Question.
Still due to my limits of how to structure an OO Solution.

Let us assume I have an order whith order items.
So one order can have 1 or more order items.

I surely have to keep track of the orders. So in an RDB I would probaly
would have a field OrderID, and let's name it order_id_items and probably
ArticleID (of course a few others also)

but it would be kept in table on it's own
with three fields
OrderID OrderItemID ArticleID.
  1         1         ArtID-01
  1         2         ArtID-02
.....

Would one do it similiar in GemStone. Having a class Order with an ID an
orderID instance variable or something different?



Regards
Friedrich

Reply | Threaded
Open this post in threaded view
|

Re: A few other questions about GemStone

otto
Hi Friedrich,

Perhaps I can give it a shot to help a bit...

> I read about GemConnect, but it seems this is just "suitable" for Oracle
> DB. Well how do I get access to other RDB in a way to "migrate" Data to
> GemStone?

If the migration is once-off (in the sense that you'd not keep
updating the RDB and have to do it frequently), then I'd do this:
write each table out to a text file (csv or something like that)
create a class in GS for each table
use CSVParser to import each table into a collection of instances of the class
write beautiful Smalltalk code to convert these tables to the OO
structures you have in GemStone

If you need to get data from your RDB continually, you could hear from
the GemStone if GemConnect can work for the RDB of your choice.

Otherwise, you can use something like http://www.glorp.org. I remember
something about the VisualWorks guys have a port that's been kept up
to date. I did not find one on http://seaside.gemstone.com/ss, but a
port should not be a huge job?

> I surely have to keep track of the orders. So in an RDB I would probaly
> would have a field OrderID, and let's name it order_id_items and probably
> ArticleID (of course a few others also)

You'll have a class called Order in GS. Then, if you use the order id
for something like printing it on a document (for reference by a
user), you'll have an instance variable called "id".

> but it would be kept in table on it's own
> with three fields
> OrderID OrderItemID ArticleID.
>  1         1         ArtID-01
>  1         2         ArtID-02

You'll also have a class called Article. If the same condition applies
as the order, you'll have an instance variable called "id" on Article.

With the info you provided here, you only need an instance variable
called "articles" on your Order, which you initialize to be an empty
Collection. (Each Order have it's own collection of Articles.) Then,
you'll add Article objects to this collection (write a method on Order
called addArticle: or something like that.)

This is possibly insufficient as you'll need to carry something like
"quantity" and "price" in a OrderItem. So, create a class by this name
and rename "articles" on Order to "items". For each Article in the
Order, create an OrderItem and add it to the order (with
addItem:quantity:price: In this method, create an OrderItem, carrying
the necessary fields.)

I like the practice of referring back to the Order from the OrderItem,
and even from the Article to a collection of OrderItems (to find all
orders for an article to manage stock, or something). Arguably, you
can derive the relationships. Also, having a unidirectional reference
makes maintaining integrity easier.

But still, I like adding "cross" references because this just makes
the Object system very powerful. For example, when I build a web page
showing an Article, it's no sweat to list Orders for this Article.

HTH
Otto
Reply | Threaded
Open this post in threaded view
|

Re: A few other questions about GemStone

SeanTAllen
In reply to this post by FDominicus
Friedrich, 

Is the order system an academic question or are you working on an e-commerce/order system?
If you are working on an e-commerce system, I'd be happy to answer any questions you have
my email address at [hidden email] as I did an e-commerce system in Gemstone.

Roughly, this is what we did ( leaving out some details ).

You have an order. Orders have line items. Line items are for a specific offers. Line items also have a quantity.
Offers are the product or combination of products at a specific price point. 

So an order has 1 or more line items. The line item is basically a quantity and the offer.
The line item knows nothing about the order in terms of id.

Order has a collection of line items as a line item is meaningless outside of an Order. The only
way on the object graph to get at line items is to ask the order for its items.

Orders are stored in the OrderSystem. Offers are stored in the OfferSystem. When an order is created,
we verify that each offer exists in the OfferSystem. An order id doesnt have any meaning in terms of
lookup except that you can tell a customer, this is order 1435X2 and that can be used by customer service
reps etc to lookup order status, issue refunds etc.


On Thu, Sep 9, 2010 at 8:38 AM, Friedrich Dominicus <[hidden email]> wrote:
Ok, I'm working towards a better understanding of GemStone. I still have
a few problems adopting to the OO approach in GemStone well and how to
get data from RDBS into GemStone.

First question:
I read about GemConnect, but it seems this is just "suitable" for Oracle
DB. Well how do I get access to other RDB in a way to "migrate" Data to
GemStone?

Second Question.
Still due to my limits of how to structure an OO Solution.

Let us assume I have an order whith order items.
So one order can have 1 or more order items.

I surely have to keep track of the orders. So in an RDB I would probaly
would have a field OrderID, and let's name it order_id_items and probably
ArticleID (of course a few others also)

but it would be kept in table on it's own
with three fields
OrderID OrderItemID ArticleID.
 1         1         ArtID-01
 1         2         ArtID-02
.....

Would one do it similiar in GemStone. Having a class Order with an ID an
orderID instance variable or something different?



Regards
Friedrich


Reply | Threaded
Open this post in threaded view
|

Re: A few other questions about GemStone

FDominicus
Sean Allen <[hidden email]> writes:

> Friedrich, 
>
> Is the order system an academic question or are you working on an e-commerce/
> order system?
It is a bloody serious commerce system for the waste management industry
Well it's at least that serious that it earned my living ;-).

If anyoone like to get in touch with me about it, just drop me a note...

I'm currently figuring out the diverse options...

Regards
Friedrich


--
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus
Reply | Threaded
Open this post in threaded view
|

Re: A few other questions about GemStone

SeanTAllen
You can contact me off list if you want and we can go through example Gemstone designs if you want.

On Thu, Sep 9, 2010 at 11:02 AM, Friedrich Dominicus <[hidden email]> wrote:
Sean Allen <[hidden email]> writes:

> Friedrich, 
>
> Is the order system an academic question or are you working on an e-commerce/
> order system?
It is a bloody serious commerce system for the waste management industry
Well it's at least that serious that it earned my living ;-).

If anyoone like to get in touch with me about it, just drop me a note...

I'm currently figuring out the diverse options...

Regards
Friedrich


--
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus

Reply | Threaded
Open this post in threaded view
|

Re: A few other questions about GemStone

Nick
In reply to this post by FDominicus
Friedrich,
 
Second Question.
Still due to my limits of how to structure an OO Solution.

Let us assume I have an order whith order items.
So one order can have 1 or more order items.

I surely have to keep track of the orders. So in an RDB I would probaly
would have a field OrderID, and let's name it order_id_items and probably
ArticleID (of course a few others also)

but it would be kept in table on it's own
with three fields
OrderID OrderItemID ArticleID.
 1         1         ArtID-01
 1         2         ArtID-02
.....

Think how would you like to express this in Smalltalk. For example

orders := OrderCollection new.
anOrder := OrderedCollection new.
anOrder add: article1.
anOrder add: article2.

orders add: anOrder.

HTH

Nick