Question

Layla just got hired as the Web developer for a small business called Axe Grinders, which...

Layla just got hired as the Web developer for a small business called Axe Grinders, which sells and repairs guitars and amps. The aging rock 'n' rollers who own Axe Grinders were taking care of business by phone and mail, but they just don't have too much time on their hands for this anymore. They decided they need a Web site so they could start processing orders more efficiently, spend their time on guitars, and get the business back in black.

These guys know music inside and out, but their guitars gently weep when it comes to Web sites. They don't need no education about the Web, so they hired Layla to do the job for them.

Layla's new bosses are same as her old boss. Part of the reason they hired her was because they thought it would be nice to have a pretty woman around the office. Layla doesn't want to be paranoid, but she is determined to prove that she's got brains and she knows how to use them.

On her first day, the owners tell Layla that they'd like their site to have some high-voltage effects. And because they have sold guitars to several celebrity musicians, they want a feature that can list their customers along with the guitar types they bought — users could either select a specific customer or guitar, or they could list 'em all. The owners have seen some other sites do something like this, so they know it is possible, but they wonder if she can make it happen. They tell her it is okay if she can't handle this task — it's just another brick in the wall. They could get satisfaction with just a plain HTML site instead, even though it would have to be updated constantly.

As she's climbing the stairway to her office, Layla realizes that scripting the Customer List feature will require more than the usual predefined JavaScript objects. And she knows that the code for the Customer List feature will include a lot of repetition. She is determined to make these features work as requested. Layla knows she's got to ramble. Because even though the owners said it would be ok to have a simpler site, she would really like to impress them.

Consider this scenario and answer the following questions.

  • How can Layla use JavaScript custom objects to create the Customer List feature for the Web site?
  • How do custom objects help Web developers with repetitive programming tasks such as the ones in the Customer List feature?
  • What other advantages do custom objects offer to Layla in this situation?
  • What are the first steps Layla should take in creating a custom object for this feature?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.) Layla can use JavaScript custom objects to create Customer List feature for the Web site. She can the

JavaScript Array prototype Constructor. The object may contain 2 fields that are customer name and guitar type the bought.

To prevent repitition, She can use Array prototype Constructor in javascript or array of custom objects as usual.

This is an example representation

function CustomerList(CustomerName,GuitarType) {
            this.CustomerName=CustomerName;
            this.GuitarType=GuitarType;
        }
var tmp = [new CustomerList('Customer 1','Guitar 1'), new CustomerList('Customer 2','Guitar 2')];

she can then render this to the list.

this saves a lot of repetition in the code and saves human effort and makes code organized.

Q2. A function to perform the repetitive task-in this case is required as data has to be entered a lot of times and Guitars may be of different types and many customers can buy same guitar type. So, this saves a lot of space and time and gives a healthy coding environment. The Web Developers can focus on logic more in this saved amount of time and implement better features. Special Functions can help to sort the list as per users wish.

Q3.

Layla leaves the constructor and the main coding object is uncluttered. This is the standard way of doing things in JavaScript, and all built-in constructors put their methods on their prototypes.Layla can “modify” objects after they’ve already been created. Using "this" keyword she can You can use closures and therefore private member variables.There are many patterns for implementing inheritance in JS, such as Constructor, Prototype Chaining, Combination Inheritance (the most popular of the lot), Prototypal, and others. It is up to the developer to decide which is easier. This approach is very simple

Q4.

Layla should take into account the variables and dependencies and also methods that are required by her custom object in javascript. Once listed with variables, Layla can move on to define methods that are functions that users can perform on list to ease their work. Like Sorting the list in their preferred order. Objects make it easy to traverse the list. She should take into notice how the implementation of list will go. Like variables can be CustomerName and GuitarType

Add a comment
Know the answer?
Add Answer to:
Layla just got hired as the Web developer for a small business called Axe Grinders, which...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Marketing problem. the offering of your Web site? 2. If you have developed a service, to...

    Marketing problem. the offering of your Web site? 2. If you have developed a service, to what other Web sites might you'"distribute" your Internet-based service? How will working with these other Web sites help you reach your target audience? Are there other Web sites from which you might accept distribution deals in order to make your product or service offering stronger? Explain how strategic distribution with other Web sites or services can give you a competitive advantage. CASE STUDY Nordstrom...

  • only question 1 and 2 Chapter Case: Hudson Kayak Adventures Hudson Kayak Adventures (HKA) offers ecotours...

    only question 1 and 2 Chapter Case: Hudson Kayak Adventures Hudson Kayak Adventures (HKA) offers ecotours and kayak rentals along the Hudson River Background Steve and Linda Lane are avid kayakers and amateur naturalists who spent many weekends exploring the Hudson River's numerous creeks and tributaries. Steve was a sales representative and Linda worked as a freelance Web designer. Two years ago, Steve'division was purchased by a rival company, which announced plans to move operations to another state. Rather than...

  • Which of the following factors would NOT be part of a process to improve a business’...

    Which of the following factors would NOT be part of a process to improve a business’ competitive positioning in a global marketplace? Focusing on customers. Practicing continuous improvement. Relying on the Internet to unite companies. Reducing product quality to keep costs low. Which of the following statements concerning the U.S. service sector today is most accurate? This sector has grown much more rapidly than the manufacturing sector. It has become the low-wage sector of the U.S. economy. It focuses less...

  • Bath Salts Online Store 1. Business Objective: Owners want to expand customer base and increase profits...

    Bath Salts Online Store 1. Business Objective: Owners want to expand customer base and increase profits while still keeping a relatively low overhead. a. Expand customer base  Create online store to supplement their Etsy account b. Increase product output  buy more materials to qualify for better wholesale price 2. Business Case: Bath Salts Boutique has existed as an LLC (Limited Liability Company) for the last 5 years. To keep costs down owners Craig and Brooke have not invested...

  • need help with answer for question 3 and 4 please no define the word I need...

    need help with answer for question 3 and 4 please no define the word I need straight to the point answers ill will like the answer Chapter Case: Hudson Kayak Adventures Hudson Kayak Adventures (HKA) offers ecotours and kayak rentals along the Hudson River. Background Steve and Linda Lane are avid kayakers and amateur naturalists who spent many weekends exploring the Hudson River's numerous creeks and tributaries. Steve was a sales representative and Linda worked as a freelance Web designer....

  • Ashley Oakley was hired by the Battleground Nurseries (BN), a commercial nursery and landscape supply company...

    Ashley Oakley was hired by the Battleground Nurseries (BN), a commercial nursery and landscape supply company in Oak Ridge, NC, as an Analyst in their newly-formed Project Office (PO). She reported to work and was assigned a small cubicle with an old laptop computer. Not what she had hoped for in her first job, but she was grateful to land her first job in a rapidly growing economy and resolved to give it her best effort. The PO reported to...

  • And there was a buy-sell arrangement which laid out the conditions under which either shareholder could...

    And there was a buy-sell arrangement which laid out the conditions under which either shareholder could buy out the other. Paul knew that this offer would strengthen his financial picture…but did he really want a partner?It was going to be a long night. read the case study above and answer this question what would you do if you were Paul with regards to financing, and why? ntroductloh Paul McTaggart sat at his desk. Behind him, the computer screen flickered with...

  • Team Conflict In a rare moment alone in her office, Jennifer Ames reflected on the past...

    Team Conflict In a rare moment alone in her office, Jennifer Ames reflected on the past 10 years of her career at BabyProduct Corporation (BPC). She could easily chart her successes: She had taken on challenges and produced results where her colleagues had failed; she had increased the diversity of the work force in every unit she had led; she had successfully launched new products and developed several new markets. In fact, just a few months before, Ames had been...

  • MacGyver Corporation manufactures a product called Miracle Goo, which comes in handy for just about anything....

    MacGyver Corporation manufactures a product called Miracle Goo, which comes in handy for just about anything. The thick tarry substance is sold in six-gallon drums. Two raw materials are used; these are referred to by people in the business as A and B. Two types of labor are required also. These are mixers (labor class I) and packers (labor class II). You were recently hired by the company president, Pete Thorn, to be the controller. You soon learned that MacGyver...

  • present a two to three paragraph post on which candidate GoTo Consulting should recommend to Melanie...

    present a two to three paragraph post on which candidate GoTo Consulting should recommend to Melanie Malone with Biotech. Consider their full body of experience and how it aligns with Melanie’s expectations for the new person as well as how they will lead within the context of the mission and vision. Use the below information , As Biotech launches a new product division to design, develop and deliver cosmetics globally, they will need to bring in someone to manage this...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT