Currency converter code reorganization

1 view
Skip to first unread message

Alexander Obuhovich

unread,
Jan 21, 2010, 5:48:17 AM1/21/10
to In-Portal Development
All currency converter classes are located in same file, not in separate files as they should. Base currency converter class is named "kCurrencyRates" (starting with "k"), but it is not part of In-Portal distribution, and belongs to In-Commerce module, so "k" should be removed. Also this class is registered not in unit config, but in kApplication class directly. At the end all classes from file "\in-commerce\units\currencies\currency_rates.php" should be moved to "\in-commerce\units\helpers" folder and named properly, because they are actually helpers.

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry Andrejev

unread,
Jan 25, 2010, 12:13:29 PM1/25/10
to in-por...@googlegroups.com
Yes, I agree with Alex.

However do we really want to create 3 separate files for each CurrencyRates class which only has 2 methods in each?

What if we properly rename and move kCurrencyRates as proposed into helpers and create a separate file for all kBankLVCurrencyRates, kECBCurrencyRates, kFRNYCurrencyRates which extend kCurrencyRates?

What's you take on this?

DA.

--
You received this message because you are subscribed to the Google Groups "In-Portal Development Team" group.
To post to this group, send email to in-por...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-dev?hl=en.


Alexander Obuhovich

unread,
Jan 26, 2010, 4:30:51 AM1/26/10
to in-por...@googlegroups.com
In case if we don't move each class declaration to separate file, then we will violate our own coding standards, but because of they are really small, then we could keep them together as you proposed.

Dmitry A.

unread,
Jan 26, 2010, 10:46:02 AM1/26/10
to In-Portal Development Team
Yes, they are super-small so I think we can do a single file in this
case.

The question remains where do we put them? They will be kind of
extensions of that Currency Helper once refactored.

What you think?


DA.

On Jan 26, 3:30 am, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> In case if we don't move each class declaration to separate file, then we
> will violate our own coding standards, but because of they are really small,
> then we could keep them together as you proposed.
>

> On Mon, Jan 25, 2010 at 7:13 PM, Dmitry Andrejev <dandre...@gmail.com>wrote:
>
>
>
>
>
> > Yes, I agree with Alex.
>
> > However do we really want to create 3 separate files for each CurrencyRates
> > class which only has 2 methods in each?
>
> > What if we properly rename and move kCurrencyRates as proposed into helpers
> > and create a separate file for all kBankLVCurrencyRates, kECBCurrencyRates,
> > kFRNYCurrencyRates which extend kCurrencyRates?
>
> > What's you take on this?
>
> > DA.
>

> > On Thu, Jan 21, 2010 at 4:48 AM, Alexander Obuhovich <aik.b...@gmail.com>wrote:
>
> >> All currency converter classes are located in same file, not in separate
> >> files as they should. Base currency converter class is named
> >> "kCurrencyRates" (starting with "k"), but it is not part of In-Portal
> >> distribution, and belongs to In-Commerce module, so "k" should be removed.
> >> Also this class is registered not in unit config, but in kApplication class
> >> directly. At the end all classes from file
> >> "\in-commerce\units\currencies\currency_rates.php" should be moved to
> >> "\in-commerce\units\helpers" folder and named properly, because they are
> >> actually helpers.
>
> >> --
> >> Best Regards,
>
> >>http://www.in-portal.com
> >>http://www.alex-time.com
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "In-Portal Development Team" group.
> >> To post to this group, send email to in-por...@googlegroups.com.
> >> To unsubscribe from this group, send email to

> >> in-portal-de...@googlegroups.com<in-portal-dev%2Bunsubscribe@goog legroups.com>


> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/in-portal-dev?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "In-Portal Development Team" group.
> > To post to this group, send email to in-por...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > in-portal-de...@googlegroups.com<in-portal-dev%2Bunsubscribe@goog legroups.com>

Alexander Obuhovich

unread,
Jan 26, 2010, 10:47:42 AM1/26/10
to in-por...@googlegroups.com
Did you miss my original post, where I've mentioned place, where those classes should be moved. In that case it will be "in-commerce/units/helper/currency_rate_helper.php".

To unsubscribe from this group, send email to in-portal-de...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/in-portal-dev?hl=en.

Dmitry Andrejev

unread,
Jan 26, 2010, 10:50:36 AM1/26/10
to in-por...@googlegroups.com
Ok so you recommend we leave all classes in a single file. I thought to break it on two files - Base Currency Converter class and separate file for Extension classes...

I am okay with a single file - it was just a thought.

DA.

Dmitry A.

unread,
Feb 6, 2010, 3:13:50 PM2/6/10
to In-Portal Development Team
Here is a task for this:

572: Refactor Currency Converter Class

http://tracker.in-portal.org/view.php?id=572

DA.

On Jan 26, 9:50 am, Dmitry Andrejev <dandre...@gmail.com> wrote:
> Ok so you recommend we leave all classes in a single file. I thought to
> break it on two files - Base Currency Converter class and separate file for
> Extension classes...
>
> I am okay with a single file - it was just a thought.
>
> DA.
>

> On Tue, Jan 26, 2010 at 9:47 AM, Alexander Obuhovich <aik.b...@gmail.com>wrote:
>
>
>
> > Did you miss my original post, where I've mentioned place, where those
> > classes should be moved. In that case it will be
> > "in-commerce/units/helper/currency_rate_helper.php".
>

Phil

unread,
Feb 7, 2010, 4:09:50 PM2/7/10
to In-Portal Development Team
Hi guys,

I'd ask a question: how many e-commerce projects had more than 1
currency enabled?

I don't know how much theses 175 currencies weight in DB, but if it
could fasten order process, I'd recommend a function to remove
unecessary currencies.

Phil.

Dmitry A.

unread,
Feb 8, 2010, 2:24:00 PM2/8/10
to In-Portal Development Team
Hi Phil,

Not to disappoint you, but I know many In-Commerce projects that have
many.

Also, there is NO additional load (considerable) related to having all
175 currencies - really small amount and loaded ONLY when needed.

This task is purely for Code Standards of In-Portal.


Cheers!

DA.

Reply all
Reply to author
Forward
0 new messages